So occasionally I have to develop a site on a sub-domain and then transfer it accross when its ready.
The process I have for this doesnt seem very good and I'm hoping there is a better way. Right now I:
1. Install new MODX on new server
2. Upload asset files from old sub-domain site (eg: .css, .js, images, etc)
3. Export tables from old sub-domain site DB (eg: site_content, html_snippets, etc)
4. Import these tables to new site
5. Re-install and reconfigure plugins.
Whenever I've just transplanted a DB as a whole I've run into loads of problems, especially around base URL and plugins.
Is there a better way to do this?
Thanks!
I recently transferred four sites from one host to another with no trouble. All plugins, snippets, and extras came along for the ride.
This was my general procedure for each one.
Old Site:
1. Empty the error log and log out
2. Export the DB with "Drop Tables" selected to SQL file
3. Zip *all* files (core separately if it's above the web root)
New Site
1. Create DB at new site and set up DB user
2. Import tables from SQL file
3. Unzip files
4. Correct the three config.core.php files (root, manager, connectors)
5. Correct any incorrect paths and URLs in core/config/config.inc.php
6. Correct .htaccess if necessary
7. Delete all files in the core/cache directory
8. Clear browser cache and cookies.
Note that I never did your step 1, though I don't think it would hurt. If you did that with the exact same version of MODX, you'd just exclude the four config files from the zip file.
It's essential that there are no hard-coded full paths any where in the install. They all need to use the MODX constants (e.g., MODX_ASSETS_PATH) in code and files, and use the System Settings (e.g., [[++assets_path]] ) in HTML.
[ed. note: BobRay last edited this post 10 years, 2 months ago.]
I tend to do a similar method to Bob Rays except as a last step I like to rerun Setup from an advanced install of the same MODX version. This will do a confirm check that everything on the site is installed correctly
Glyn Szasz
Sydney, Australia
Happy to help (when can) and happy to learn
If you are a Sydney based MODX developer would love to hear from you. Please contact me.
I'll try Bob Rays method next time. What always works for me is:
1. Export old DB
2. Install fresh modx on new server
3. Drop fresh DB
4. Import old DB
5. Copy whole assets folder from old to new server
6. Copy core>components & core>packages from old to new server
7. Clear cache
8. Log in
note: Install same versions of modx