How Do I Migrate/Copy a MODx Site for Use as a New Site?

Hoping to obtain tips for migrating a MODx site for me to use as a new website so that I don’t have to start completely from scratch. I updated MODX version of the old site, installed the new MODx site for my new project, imported various assets, and also the contents of core/components, and core/ packages. I am now stuck on the “inject” database portion. I selected my new database at the new site location, and clicked import, but received errors. Does anyone have tips for what I might be doing incorrectly.

What I usually do is zip the original site then export the database to a .sql file or .txt file.

I then upload the .zip file to the new (other) server and extract the files. Then create a new empty database and copy / paste from the .txt file.

Edit the config.core.php files (in root, connectors, manager) to update the paths to the new install. Then in the core/config/config.inc.php file, edit the paths and then change the database credentials to match the new database.

Rewriting response after making a discovery. First, I do truly appreciate your feedback, and may actually move to the method you suggested. When you say copy and paste from the txt file… do you mean copy and paste into each of the 99 or so tables that display in phpMyAdmin via the cPanel?

On another note… I went to backup the database from the new install just in case… and discovered that… when I had performed the export of the old site’s database… I exported the wrong file. Now I have the actual file which has the database name instead of ‘localhost’ in the file name. I will try importing that one.

:slight_smile:

I paste (into sql box) into an empty database - there are no tables there as it’s a new database.

If you have PHPMyAdmin in your hosting control panel, you can export the database from a MODX site with the right MODX version and minimal content, then import it into the new database for the new website before you start adding the content.