If you have SSH access to your source server, you can quickly bring almost any PHP/MySQL site into MODX Cloud quickly via the command line, including Evolution (formerly MODX Evolution). This method requires basic knowledge of web servers and using SSH to connect to them.
1. Set Up a New Flex Cloud for the Destination
- The first step is to create your destination Cloud instance, using the Flex Cloud type Cloud.
- From the Cloud Edit view of the newly created Flex Cloud, locate the internal Cloud URL that includes c****.paas*.**.modxcloud.com
- Scroll down to reveal the SSH and Database (MySQL) credentials for use later in the import process.
2. Connect to the Original Site via SSH
- Connect to the source Evo website using SSH at your current web host.
- Once you change directories to the Evo web root (
cd), enter the following command to get the original database credentials and note them for later:
3. Dump the Database
Use the MySQL CLI tool to dump the database that will be used to load into your new Cloud. You may need to switch to root privileges (
sudo -s) to get this to work:
mysqldump -p -u username dbdname -r db.sql
This will create a “db.sql” file which you’ll use to populate your DB in Cloud.
4. Sync the Files to the Flex Cloud
Using the information from step 1 above, send the files from the web root of the origin server to the Cloud using rsync while logged into the origin server:
rsync -azvvP . <cXXXX>@<cXXXX_cloud_URL>:~/www/
When prompted choose "yes" to transfer the files over.
5. Update the DB Credentials for the New Cloud
Use your credentials from step 1 above to login to the destination/new site in MODX Cloud. Once you're there, update the Evo configuration file to point to the database for this MODX Cloud instance.
cd ~/www/; nano manager/includes/config.inc.php
This will open the Evo config file in the nano text editor so you can update to point to the Cloud database. Use the credentials from step 1, above. Once done, proceed to Import the DB using the instructions below.
6. Import the DB into the New Cloud
While still logged into SSH in the destination Cloud instance from Step 5, change to the webroot directory and import the DB dump you created in Step 3 above.
mysql -u username -p database_name < db.sql
7. QA Review of the Site in Cloud
Now that you have moved the files, updated the configuration and imported the database, take the time to make sure everything is working as it should. Log in to the Evo Manager in the destination Cloud, clear the cache and test the site from the front end. Try editing pages in the site tree to ensure everything checks out and functions.
If you have an existing custom SSL certificate also install it now using our guide on Installing Custom Certificates
For a final check, if you know how, you can modify your local computer's hosts file to point to Cloud for the URL for a final review before actually updating the IP address at your DNS provider.
8. Add Custom Domains, Update DNS and Launch
If everything checks out OK, add custom domains to the Cloud in the Dashboard. Once done, you can update your DNS to point to the Cloud IP address. After the site resolves (test using WhatsMyDNS.net) to the MODX Cloud server, issue a free SSL Let’s Encrypt certificate (if you didn't install a custom cert already), and adjust your Web Rules as appropriate.
That’s it, your Evolution site should be live and blazing fast in MODX Cloud.