Hello,
I am new to MODX - recently “inherited” several sites running on 2.6.5-pl. Seems to me, some of these have been heavily customized. The original developers are not available, nor is there any documentation.
Some of the sites run on PHP 5.6, which will be shut down very soon, so my first job is to update the PHP version to 7.3, next will be updating to the most recent MODX version.
It looks like 2.6.5-pl core will run just fine on PHP 7.3 ?
If anyone could direct me to best practice of the update procedure - thanks!
I plan on using Akeeba Standalone for backup, which allows me to revert. I do not have SSH access. I am also considering to duplicate the site locally, just in case the Customizations / Extras give me trouble.
The basic procedure is to download the latest version via MODX.com/download, unzip that, and upload it to your site. After that, open the installer (at yoursite.com/setup) and follow the steps.
To be cautious, make sure you have a copy of the files and database before starting.
To speed things up, you can install the UpgradeMODX extra which will handle downloading and putting in place the files for you.
There’s also SiteDash which can upgrade sites remotely with one click, but it’s useful to get comfortable with the general procedure first.
Thank you for taking the time. Sounds easier then I thought ;).
I have updated PHP to 7.3 and get Cache Warnings (sorry, I am at home now and can’t recall the exact message), on PHP 7.2 all seems good.
After a bad upgrade that trashed the site in the early days of MODx, I adopted the somewhat labor intensive technique of copying the entire site and pointing the domain once I’m sure it’s working. It only takes me about 30 minutes, so it might depend on how much downtime you can spare. It might not work to good for sites with constant updates to the database.
Lets say the old version is in a folder called /site-modx-265/
Download v2.8.1 and unzip to a new folder such as /site-modx-281/ or whatever the new release is.
Download a backup of the existing SQL database, the existing core/config/config.inc.php file, the root .htaccess file and whatever icons and such might be in the root folder.
Create a new SQL database and edit the backup config.inc.php file to use the new database credentials. Also find&replace any raw folder paths in the file and update them to the new folder path.
Perform step 3 on the database backup file.
On the server, copy all custom files from the old /site-modx-265/assets/ folder over to the new location at /site-modx-281/assets/.
Copy all files from /site-modx-265/core/components/ over to /site-modx-281/core/.
Copy almost all the files and folders from the /site-modx-265/core/packages/ folder to the new /site-modx-281/core/packages/ folder. DO NOT COPY over the /core/ folder or the core.transport.zip file.
Find the new root ht.access file from your new installation folder and compare the old root .htaccess file with the one included in the new version to copy over any changes from the old to the new. Then upload the new an improved .htaccess file back to the server.
Import the upgraded SQL database file into the new database.
copy the upgraded config.inc.php file over to the new /site-modx-281/core/config/ folder.
change the /site-modx-281/core/ht.access file to .htaccess.
Setup a temporary subdomain such as staging.yourdomain.com and point it at your new /site-modx-281/ installation.
When the subdomain is working visit https://staging.yourdomain.com/setup and run through setup. If things are configured correctly it will automatically select the upgrade option and you should not get any error messages. Have it delete the setup folder at the end.
Log into the new manager and see if everything is working.
Once you are satisfied that the new site is running perfectly flush the cache, log everyone out. Then point your primary domain to the new installation folder.
Log back into the manager under the primary domain and test the site just to be double sure.
Hopefully I didn’t miss a step. If something fails you have time to track it down since the old site is fully functional. Worst case you can blow away the entire upgrade and start over.