Yesterday, for the first time, I attempted to move a site from my development hosting to the client's live hosting. I followed the manual. I used FTP to move the files, I exported the DB and imported it. At one stage the site worked but the login page for Manager had a php error. This led me down a rabbit warren looking for file permissions etc.
The whole thing was fraught with problems and a degree of frustration and after about 4 hours (half a day!) I gave-up. Instead I manually copied and pasted the contents of resources and elements, which is fine for a small site (5 pages) but would be completely unfeasible for a large site (also because I didn't re-create the resources on the live server in the same order I did on the dev server, I had to hunt down and change the number that goes in [[ ~ here ]] in various places).
So ... what to do ?
1. Practice until I work-out how to do this?
2. Use modxcloud (as far as I know their platform manages all this)?
3. Manually copying is not an option!
After the site went live, I made a few tweaks at the client's request. Now I have a live site that is out of synch with the development site and this is not good! I want the development version to always be in step with the live. What strategy do you guys have for this?
Thanks for any advice!
Tony
-
☆ A M B ☆
- 24,524 Posts
Until the site gets too big, you can use Vapor to package it up, then on the new server install the same version of MODX and install the Vapor package. The problem with it is that if it's run from the browser, it has all of the usual timeout and memory use limitations of any PHP script.
If you are comfortable using SSH, you can use
Teleport. This is the officially approved way of moving sites around. It works in much the same way - creates an installable package - but is much more robust.
A few things to worry about. PHP version compatibility, MySQL version (and charset and collation) compatibility, and some settings such as timezone that may need to be adjusted.
Using FTP to move the files individually often causes trouble due to missing or corrupted files. MODX has thousands of files and it's common for some of them not to make it intact. Getting a PHP error is a common sign of this (though it can also be caused by the new site having a different version of PHP).
The solution is to use Vapor or Teleport, or to zip up the MODX files (leaving out all the config files), FTP the zip file, and extract them on your server.
Another stumbling block is the Rewrite Base line in .htaccess (I turn off FURLs and rename .htaccess before moving a site).
I don't think this is an issue any more, but in some older versions the path in the modx_workspaces table can also cause trouble.