It is strongly recommended to create a backup before starting the update process. If you have important data, create and try to restore a backup to ensure that everything works properly.
To upgrade to the latest version of MODX, follow these steps:
NOTE: The steps below are only applicable to MODX 2.x.
Log out of the MODX Web-based administration panel if you are currently logged in.
Stop the servers using the commands below (on Linux and Mac OS X) or the graphical manager (on all platforms):
$ sudo installdir/ctlscript.sh stop apache $ sudo installdir/ctlscript.sh stop mysql
Clear the contents of the MODX cache directory:
$ rm -rf installdir/apps/modx/core/cache/*
Install the rsync utility (Linux and Mac OS X) or an FTP/file copy utility that supports directory merging (Windows). Read more about this requirement in the MODX documentation.
$ sudo apt-get install rsync (Linux) $ brew install rsync (Mac OS X)
Download the latest version of MODX from the official website.
Uncompress the downloaded archive to a temporary directory on your system. Use the unzip command (Linux and Mac OS X) or an equivalent file compression utility (on Windows).
$ cd /tmp $ unzip modx-2.x.y.zip
Merge (don’t overwrite) the new MODX files with the existing files using rsync or your chosen file copy utility. Note that the core/ directory is to be placed in a different location in the Bitnami MODX stack and is therefore copied separately.
$ rsync -avuh /tmp/modx-2.x.y/ installdir/apps/modx/htdocs/ $ rsync -avuh installdir/apps/modx/htdocs/core/ installdir/apps/modx/core/ $ rm -rf installdir/apps/modx/htdocs/core
Ensure that the installdir/apps/modx/htdocs/setup/ directory is writable by the user that the stack was installed as.
Restart the servers using the commands below (on Linux and Mac OS X) or the graphical manager (on all platforms):
$ sudo installdir/ctlscript.sh start apache $ sudo installdir/ctlscript.sh start mysql
Browse to http://localhost/modx/setup.
You should see a warning screen like the one below. Set the MODX_CORE_PATH variable to installdir/apps/modx/core and submit the new value.
Proceed through the upgrade process. Remember to select the “Upgrade Existing Install” option on the “Install Options” page.
NOTE: If the “Upgrade Existing Install” option is not available, refer to the MODX upgrade troubleshooting instructions. Avoid selecting “New Installation” on this page as doing so will overwrite all your existing MODX data.
On the “Installation Summary” page, ensure that all checks are passed. In case of errors, refer to the MODX upgrade troubleshooting instructions. If all checks pass, click “Install” to proceed.
Once installation is complete, check the box to delete the setup/ directory and log in to MODX again to access the upgraded version.
NOTE: It is important to verify that the setup/ directory has been deleted. If not, delete it manually.