Creating Snapshots to Import Directly into MODX Cloud.
Vapor is a custom application which will package many MODX Revolution sites into a Snapshot which you can import into MODX Cloud. The source sites can come from another web host or even a local development environment.
The following are the basic steps to import an existing MODX Revolution site into MODX Cloud:
- Upload or place the Vapor script alongside your MODX Revolution Site
- Run Vapor from the command line or HTTP
- Import the Vapor package into MODX Cloud
- Inject the Snapshot into an existing Cloud or create a new Cloud from the Snapshot
Notes on Usage
- Vapor may not work on every MODX Revolution install; some unique environments may leave you with incomplete data.
- Vapor works best when run from the Command Line; running it from your browser via HTTP will generally work but increases the likelihood of an incomplete or missing snapshot.
- If you have trouble with zip files or package management on your server you may (but not necessarily) encounter issues.
- While you can package an Advanced install, Advanced installs are not yet available on MODX Cloud. Your site will work with the default core and Manager locations. MODX Cloud has protections to prevent access/browsing of these directories.
Using Vapor at the Command Line (Recommended)
Running Vapor at the command line is recommended as it is the most reliable method for most sites on most servers. If you can access your server using a command line utility or SSH tool, use the following steps to run Vapor.
Open a command line utility such as Terminal on OSX, PuTTY on Windows or your favorite terminal in Linux.
Connect to the server of the site you wish to package via SSH (replacing user and the site URL with your own data) as follows:
$ ssh firstname.lastname@example.org
Navigate to the directory containing your MODX Revolution site.
Create a new folder called vapor and then change to the vapor directory by running the following two commands:
$ mkdir vapor
$ cd vapor
Fetch the Vapor zip using the wget command (if available as follows):
$ wget http://modx.s3.amazonaws.com/releases/vapor/1.0/vapor-1.0.0-pl.zip
Extract the file into the vapor directory you created in the last step, as follows:
$ unzip vapor-1.0.0-pl.zip
While in the vapor directory, execute the following command:
$ php vapor.php
Vapor will output the results to the command line; no displayed errors should mean your package is fine.
Change directories to /core/packages/ to to confirm the vapor package was created. It should be named something like yourmodxsite.com-120712.1932.27-2.2.1-dev.transport.zip.
You're now ready to import your Snapshot.
Using Vapor with FTP/HTTP
If you do not have SSH access but have (s)FTP access to your server you should be able to package smaller sites using this method. This method should work with sites without large databases or image/media directories.
Download the Vapor zip and unzip it.
Using your (s)FTP client (such as cyberduck, FileZilla or Transmit) login to your server and create a folder named
vaporin the directory where your MODX site is installed (where your index.php file resides).
Upload the unzipped Vapor files into the newly created
Login to the site's MODX Manager as an Admin User so your browser has an active session to allow it to function correctly.
From your browser navigate to the vapor/vapor.php file which will start Vapor. If your site is at http://yourmodxsite/ you'll want to go to http://yourmodxsite.com/vapor/vapor.php.
Vapor will output the results; no displayed errors should mean your package is fine.
Using your (s)FTP client, locate the package Vapor makes in /core/packages/and note the full URL or place in a publicly web accessible directory for importing. DO NOT RENAME or otherwise modify the file!
Follow the instructions to import your Snapshot.
Special Version Handling Once in a Cloud
- Source sites below Revolution 2.3: requires you to Reinstall Product after the Cloud is created from the Snapshot or you inject your Snapshot into a Cloud which is 2.3 or higher.
- Source sites below Revolution 2.1: most likely requires all Extras be downloaded and installed as they do not correctly populate the file system. The Extras will show in the list of Snapshots and Plugins in the Elements Tree but the files are not there. Until installed you may experience 500 errors on the site and trying to edit documents.
- Source sites containing pdoTools, MIGX, Articles or Gallery: may require you to uninstall and reinstall the Extras via the Package Manager in order for these to work correctly after being injected into a Cloud, due to paths and file location issues.
Import Your Snapshot
Importing Snapshots is done from the MODX Cloud Dashboard.
Login to the Cloud Dashboard and navigate to your Vault.
click the Import Snapshots button at the top-left of the Snapshots tab.
In the pop-up dialog, choose a Category or create a new one.
Paste the publicly accessible URL of the Vapor Snapshot into the field.
Click Import Snapshot to start the import which, depending on the size and connection could take a few minutes. You'll receive an email upon completion of a successful import.
Your Snapshot is ready to be Injected into an existing Cloud or Create a new Cloud with it.