<

Moving a ModX Revolution Site to Another Server

Published on
9,610 Points
3,610 Views
Last Modified:
Approved
Since I am currently running into this issue right now as I type this, I though I would share my experiences with moving a ModX Revolution site from one server to another.  It is not an easy task, but can be accomplished rather easily.

The first thing you will need to do is to verify that your new server has PHP and MySQL installed, along with the PDO drivers.

Next step is to search through your current database and change any physical paths it may contain to point to your new directory structure on the new server.  Once you have this done you are ready to do a mysqldump, if you have access to phpMyAdmin, take the easy route and simply do an export.  Make sure to checkoff the dump/create tables.

MySQL Dump Command:  
mysqldump -u username -p your_revo_db > /path/to/backups/my_revo_db.sql

Open in new window


Once this is done, make sure you log into your current site’s manager, and clear all your site’s caches and sessions.  If in doubt, simply get into your directory structure and remove everything in the /core/cache folder

Now, package up all your files, and transfer them to the new server.  Make sure you remember the path to these new files, because you will need to update the following files in order for the site to come up again for you.

/core/config/config.inc.php
Change the path to the following variables, to the value of your new server path
$modx_core_path
$modx_processors_path
$modx_connectors_path
$modx_manager_path
$modx_base_path
$modx_assets_path
/config.core.php Change  $http_host = 'yoursite.com';
/connectors/config.core.php  Change:  define('MODX_CORE_PATH', '/path/to/modx_doc_root/core/');
/manager/config.core.php  Change:  define('MODX_CORE_PATH', '/path/to/modx_doc_root/core/');

Ok, now that you’ve got the files squared away, go ahead and import your database, either through the phpMyAdmin Import interface or through a command like:  
mysql -u username -p target_db < my_revo_db.sql

Open in new window


Once your database has successfully been imported, you may need to make one last change… There is a value in the XXX_workspaces table, you may need to change the path value in here.  If it looks like {core_path}, just leave it alone.

Please make sure you have all your new permissions set properly on your new server, and you should be good to go!

Have fun, and happy coding!

~Kevin
0
Author:kevp75
Enjoy this complimentary article view.

Get unlimited access to our entire library of technical procedures, guides, and tutorials written by certified industry professionals.

Get 7 days free
Click here to view the full article

Using this article for work? Experts Exchange can benefit your whole team.

Learn More
COLLABORATE WITH CERTIFIED PROFESSIONALS
Experts Exchange is a tech solutions provider where users receive personalized tech help from vetted certified professionals. These industry professionals also write and publish relevant articles on our site.
Ask questions about what you read
If you have a question about something within an article, you can receive help directly from the article author. Experts Exchange article authors are available to answer questions and further the discussion.
Learn from the best.