Removing Old Package Versions

How to safely remove old versions of transport packages


After running a MODX site for a while, you may end up with many versions of the various packages you have installed. You might be tempted to just delete the packages from the core/packages directory, but that's something you should never do.

Every version of every package you've installed is registered and stored in the MODX database (in the modx_transport_packages table). If you delete the files manually, MODX will continue to look for them every time you go to Package Manager and fill up your error log with complaints when it doesn't find them.

The correct thing to do is to remove them in Package Manager, but the method is a little obscure and you may not have noticed it.

Go to System | Package Management. Next to the package name, you should see some buttons (in some browsers, you may have to click on the little plus sign next to the package name and scroll down to reveal them). Click on the "View Details" button. That will take you to the Package Detail panel. On that panel, you'll see two tabs. Click on the "Uploaded Versions" tab. You should see a list of all the package versions with the most recent version at the top.

You can right-click on any package except the one that is currently installed and select "Remove Package Version" to remove it. The version that is installed on your site may not be at the top of the list because you may have downloaded newer versions, but not yet installed them. Check the "Installed" column to see which one is installed.

It may not make any difference, but if there are new versions that are not installed, I always go back the main Package Manager panel and install them before starting to remove older versions. I believe it's safer to do it that way.

If there are versions in the database for which there are no transport package files to remove, MODX can get confused because it expects to find them there and uses the information in the transport package to guide the removal of packages. It will also get confused if the package signature or source fields are incorrect in the database. I use SiteCheck before deleting any packages. It will correct the signature and source fields, if possible, and will check to make sure the transport package files are there. If they're not, SiteCheck will download the transport files from the MODX Repository automatically.



Comments (0)


Please login to comment.

  (Login)