Sub topic 10
Managing licenses and upgrades
This chapter assumes you can navigate Setup, know the difference between a sandbox and production, and have already installed a package in a sandbox. It covers what happens after installation: who consumes a license, and how a new package version reaches your org.
How package licenses work
A managed package from AppExchange can be licensed. When it is, the publisher controls how many people may use it, and Salesforce enforces that limit. Unlicensed packages, and most unmanaged packages, have no such control.
To see license details, go to Setup, search for Installed Packages, and click Manage Licenses next to the package. The page shows these fields:
| Field | What it tells you |
|---|---|
| Status | Whether the license is active, in trial, or expired |
| Expiration date | When access ends, or "Does not expire" |
| Allowed licenses | The number of seats you bought, or "Site License" |
| Used licenses | Seats already assigned to users |
There are two common license models:
- Per-user license. You assign a seat to each user. When the seats run out, you must free one or buy more.
- Site license. Every user in the org can use the app, and the seat count does not apply.
A license is separate from access. A user needs a license seat and the app's permission set. A user with only one of the two cannot use the app. When a user cannot see the app, check both.
Assigning and recovering seats
On the Manage Licenses page, click Add Users to assign seats to people. You can also remove a seat from someone who has left a project. Do this regularly, because unused seats cost money and each active seat widens your exposure.
sf package installed list --target-org my-sandboxRun this command to see the installed version number. Record it before every upgrade. You will want it if you need to roll back.
Upgrades: managed and unmanaged packages
How a new version reaches your org depends on the package type from the earlier chapter.
- Managed packages upgrade in place. Your data and the components you configured stay. The publisher can also push an upgrade to your org, so the version can change without you starting it.
- Unmanaged packages have no upgrade path. Installing a newer version creates copies of components next to the old ones, or overwrites your edits. Treat each new version as a fresh install and review the differences by hand.
For a managed package, installing the newer version is the upgrade. Use the 04t ID from the new version's listing:
sf package install --package 04tXXXXXXXXXXXXXXX --target-org my-sandbox --security-type AdminsOnly --wait 10Run the install in a sandbox first. Then compare the result against the old version, as described below.
What to check before and after an upgrade
Read the release notes first. Look for new permissions, new external connections, and removed features. An upgrade can add a new permission set or new fields, which means the access you reviewed at install time may no longer be the access the app has.
After the sandbox upgrade, verify these points:
- The installed version matches the one you intended.
- Existing users still have the access they need, and no one gained more than they should.
- Your key business processes still work, such as page layouts, flows, and integrations that use the app's objects.
- New permission sets or settings are reviewed before you assign them.
Common mistakes
- Counting only seats. You assign a license but forget the permission set, so the user sees nothing.
- Skipping the version record. Without it, you cannot tell whether a problem began with an upgrade.
- Upgrading production first. The sandbox exists to catch problems like these.
- Leaving expired trials in place. An expired license can lock users out of an app that a business process depends on. Put expiration dates on a calendar.
If an upgrade goes badly, you can remove a package that has no dependencies and then reinstall the earlier version. That route is limited for managed packages, because you cannot reinstall an older version over a newer one. Plan for that before you upgrade, and rehearse the removal as covered in the uninstall chapter.
Exercise
A user reports that they cannot see a newly installed licensed app, although you added their name on the Manage Licenses page. What do you check next, and why?
Show answer
Check whether the user has the app's permission set. A license seat lets the user use the package, but the permission set grants access to its objects, fields, and tabs. Both are required.
Exercise
Why is an unmanaged package harder to upgrade than a managed one?
Show answer
An unmanaged package has no upgrade path. A newer version installs as new components next to, or over, the old ones, so you must compare and merge the changes yourself. A managed package upgrades in place and keeps your data and configuration.