I'm trying to set up a one-click environment transfer development -> production and production -> development that are located on the same server under different subdomains. They use different databases, have a different root folder, and a different web address.
Right now I'm going through a somewhat lengthy process of backing up an entire folder, then expanding it in the other folder using cPanel. Then overwriting the config files to have the correct database and file/folder info. Then, using cPanel I generate a database copy and using heidiSQL I replace the database (except the managerlog table)
I'm thinking of setting up a php script on a separate domain that transfers the database and files, but it's a bit of a tedious process, and wanted to see before I invest too much time into this if anyone's dealt with this already.
I don't have a good solution to offer, but it will save you some time and trouble if you exclude the config files from the .zip file on the development machine.
core/config/config.inc.php
config.core.php
connectors/config.core.php
manager/config.core.php
(There's one in the setup directory as well, but I'm assuming you're not transferring that.)
-
☆ A M B ☆
- 1,031 Posts
If you could access the Apache sites-enabled files, this would be only a swap of the sites-enabled configuration files for the two installations. Simple said: the webroot for both installations is swapped. No edit of config files needed (the paths/databases are the same). You just have to clear the cache of both MODX installations.
I have not tried that with MODX installations, but with other systems.
-
☆ A M B ☆
- 1,031 Posts
@scorche: Yes, I have missed the .htaccess entries. Using more universal regex strings in that could avoid swapping/changing those files.
I ended up running a couple of functions to do this.
One backs up the entire db (except the manager_logs) to a file
Next one reads the file into the desired database
Finally I copy the files over skipping the config, htaccess, and any cache files
I also have it updating the page as I go along to see the process any any errors. Takes usually under two minutes.