How to Move Almost any MODX Revolution Site
The high-level process to migrate a site manually is covered in detail in the MODX documentation. Here is an overview of the steps:
- Create a blank Revo site in MODX Cloud, matching the version from your source site
- Get a DB export and copy of all your site assets
- Import your DB using phpMyAdmin
- Copy your files to your new Cloud instance using SFTP
- Update your config files/paths
- Reinstall Product to clear the cache and make sure things are working
- Confirm your site works as expected and back it up
- Upgrade to the latest version of MODX for security
- Cleanup the working files and backup your site
- Point your DNS to the Cloud instance
Create a New MODX Cloud
This will be where you import your files and database to. If this is your first time using MODX Cloud read the complete instructions for creating a new Cloud, first. In order for things to go smoothly choose the the same version as your source site to ensure things go smoothly. From the right hand side of the New Cloud screen, click on Change Version.
Exporting your Source Site DB
Using phpMyAdmin or your favourite MySQL tool, export your current site's complete database to a SQL file. Ensure that your DB is exported with Drop Table statements in order to overwrite the blank Cloud database that will be created as part of the next step, and make sure your table prefix is “modx_”—if it isn't use a text editor to change the table prefix to “modx_”. Sometimes a host or developer will supply you with a SQL export. Provide these instructions to them for reference.
Import your Database with phpMyAdmin (PMA)
- From the Add-ons tab of your new Cloud instance, toggle the phpMyAdmin option under the Software section. When the confirmation dialog pops up, press the "Install phpMyAdmin" button.
- When this is completed, return to the Summary tab and press the "Show Details" button to reveal your MySQL username and password.
- Press the "Open phpMyAdmin" button next to the MySQL header to open PMA in a new tab. Use the credentials from the second step to login to PMA.
- Import your source site's database using phpMyAdmin's Import window.
Upload your Files
Login to your Cloud via SSH (the credentials are displayed on the Cloud Edit Page) to upload your site files. The directories you will need include: all assets folders, core/packages/, and core/components/ … don't forget any custom favicons you may have!
WARNING: In your core/packages/ folder, do NOT overwrite the core.transport.zip file or the core/packages/core/ folder.
Update your Config/Settings
Using SSH or SFTP, check your site's core/config/config.inc.php file to ensure it contains the correct paths. This should already be the case unless you've renamed your /assets/ folder.
Additionally, if you used a custom DB prefix, you would need to specify it in the config file.
After you have uploaded your files and imported your database, clicking the “Reinstall Product” button in the sidebar of your MODX Cloud instance’s Dashboard page will clear your cache, and make sure that all the correct MODX files are in the right place.
Confirm your site works and take a Snapshot
After you have confirmed your site is working as expected on the same version of MODX Revolution as your source site, take a Snapshot. You could name this something like “Successful Import from 2.x.x”, where “2.x.x” is the source version.
Upgrade to the latest version for security
Keeping up with upgrades is a critical part of keeping your site and any important data it may have safe. Use your Snapshot created in the last step as a safety net, to clone a new site for testing upgrades to the latest version of MODX.
If you’re coming from 2.2.x or earlier, it's best to upgrade to 2.3.x then 2.4.x then to the latest version of MODX Revolution.
After you've upgraded your site, make sure to bring all your Extras up to date using the Installer inside MODX.
After you have confirmed your site is working, uninstall phpMyAdmin by toggling the button from the Add-ons tab in the MODX Cloud Dashboard for any working instances you created.
If you upgraded your site and it works as expected, you can also safely delete the working import Cloud instance project. This assumes that you have followed steps 8 and 9, and will be going live with an upgraded version of your source site.
You can also delete any SQL dump files that may be loaded on your server, .htaccess files since MODX Cloud uses NGINX web rules.
Launch Your MODX Cloud Site
Update the A-record in your website’s DNS provider—often your domain registrar—to point to the public IP address shown on your Summary Tab. Depending on your TTL setting, your site visitor traffic should start serving from MODX Cloud in as little as a few minutes.