Uninstalling a package¶
Uninstalling removes an installed TRM package from the SAP system you are connected to: its objects, its ABAP packages, its customizing, and its TRM record. TRM can also carry the removal through the rest of your landscape.
Before you start¶
- The package must be installed on the connected system:
trm listshows the installed packages. - The registry the package was installed from must be reachable. TRM asks the registry to
generate the transport that deletes the objects, so an uninstall can't run fully offline. A
package installed from a
.trmfile is uninstalled through the registry it was published to. - trm-server and trm-rest can't be uninstalled: TRM needs them.
- Objects of the package must not be locked in open transport requests.
What happens during an uninstall¶
- Local changes. If the package is dirty (its objects were changed
on this system), TRM lists the changes and asks before deleting them.
--ignore-dirtycontinues without asking. - Dependants. If other installed packages depend on this one, TRM lists them and asks before
continuing: they might stop working.
--no-dependantsskips this check. - Packages installed inside it. If other TRM packages are installed inside the ABAP packages of this one, they would be deleted with it. TRM lists them and asks, then uninstalls each of them first, with the same options.
- Locks. TRM locks the package, its ABAP packages and its transport.
- Deletion transport. TRM builds a transport that deletes the objects of the installed release, and imports it on the system. See What is deleted.
- Landscape. TRM adds the deletion transport to the import queue of the transport target, so the package is removed from the following systems too. See Removing the package from the landscape.
- Record. TRM removes the package from its records:
trm listno longer shows it.
⚠️ Don't interrupt an uninstall while the deletion transport is being imported.
What is deleted¶
| Content | Result |
|---|---|
| Objects installed by the package | Deleted. |
| ABAP packages of the installation | Deleted. |
| Objects a developer created inside those ABAP packages | Listed, then deleted after confirmation. They live in packages that are being deleted. |
| Objects of the package moved by someone to another ABAP package | Kept, unless you confirm their deletion. |
| Objects that belong to another TRM package | Kept. |
| Customizing rows imported by the package | Deleted. See Customizing guidelines. |
| Table data | Deleted with the tables. Back it up first if you need it. |
| Namespace | Deleted only when no other ABAP package uses it, and never when the system develops in it. |
| Objects created by post activities | Not removed: TRM doesn't know them. |
Before deleting objects that were never part of the package, or customizing rows matched by a generic key (which may include rows the package didn't ship), TRM lists them and asks.
Removing the package from the landscape¶
When you installed the package, TRM released a landscape transport
that carried it to your quality and production systems. The uninstall does the opposite: the
deletion transport is added to the import queue of the transport target you choose
(--landscape-tr-target). Import it like any other transport, and the package disappears from the
following systems too.
The deletion transport isn't forwarded when the system has no transport targets (TRM considers it
the last system of the landscape) or when the package was installed into temporary ($) packages.
The TRM record is removed only on the system where you run the uninstall. Following systems don't record TRM packages: they only receive transports.
If something fails¶
TRM undoes the completed steps: it re-imports a copy of the deleted objects, restores the TRM record,
reinstalls the nested packages it uninstalled, and removes the deletion transport from the import
queue of the connected system. If the deletion transport was forwarded to another system's queue,
TRM can't remove it from there: the log tells you to remove it in STMS.
Uninstalling without prompts¶
With --no-prompts, TRM stops instead of asking in the risky cases:
| Situation | Without prompts |
|---|---|
| Local changes | Stops, unless --ignore-dirty |
| Installed packages depend on it | Stops, unless --no-dependants |
| Other TRM packages installed inside it | Uninstalled too, with a warning in the log |
| Objects created inside its ABAP packages | Deleted, with a warning in the log |
| Objects moved to other ABAP packages | Kept |
| Customizing rows to delete | Deleted, with a warning in the log |
| Transport target | Required when the system has more than one target (--landscape-tr-target) |