First of all SSH into your web-server.
Then find the latest stable version of MODX and download it directly onto your server.
$ wget https://modx.com/download/direct?id=modx-2.5.7-pl.zip --no-check-certificate
Unzip the file.
$ unzip modx-2.5.7-pl.zip
For ease of use, rename the extracted folder to something shorter.
$ mv modx-2.5.7-pl modx
Backup existing set-up
Plan for the worst!! So lets backup your current set-up.
In the Manager, use the menu bar to clear the cache and logout all users.
Dump the database
We want to have a safe copy of our database.
Make sure you have the database password. This can be found in core/config/config.inc.php.
Now dump the database, making sure you replace USERNAME and DBNAME with your database name and username.
$ mysqldump -u USERNAME -p DBNAME > DBNAME.sql
Use tar to make a safe backup of your files, just in case!
$ tar -cvzf backup.tar.gz .
If for some reason you have files or folders that you want to exclude from the backup, you can use
$ tar -cvzf backup.tar.gz . --exclude='myfolder'
You can download this archive file using an ftp program like FileZilla.
Install new version
Navigate to your new modx folder we made earlier.
$ cd modx
Now copy the newly downloaded version over our current one. If rsync is new to you, take a look at this useful article and consider using the
$ rsync -avP connectors/ ../connectors*/ $ rsync -avP core/ ../core*/ $ rsync -avP manager/ ../manager*/ $ rsync -avP setup/ ../setup/
Navigate out of the modx folder.
$ cd ..
Check config files
After doing any kind of update it is worth checking that your config files contain the correct settings.
$ nano core*/config/config.inc.php $ nano config.core.php $ nano connectors*/config.core.php $ nano manager*/config.core.php
Depending on how your server is configured, you may need to set the permissions of the setup directory
$ chmod -R 755 setup
Visit the setup url - yourdomain.com/setup
Follow the instructions, making sure you select Upgrade Existing Install
Once complete, log in to the Manager to check that everything is working as it should.
Missing items in Manager
Sometimes items will be missing or unresponsive in the Manager. This can be because some js files are not running due to the wrong permissions. You can try the following
$ chmod 755 manager $ chmod 755 manager*/index.php $ chmod 755 connectors* $ chmod 755 connectors*/index.php $ chmod 755 connectors*/modx.config.js.php $ chmod 755 connectors*/lang.js.php
Hardening your MODX install
MODX, like all CMS's, could be exploited by unscrupulous individuals. Use this article to harden your MODX install.