It is common as a Magento developer to have to move a Magento installation from one location to another. The normal way to move a site is to compress the web directory, dump the database, move the data to the new location, and finally adjust the configuration as needed. Moving a Magento commerce site requires the same general procedure. However, the devil is in the details.

“It’s the little details that are vital. Little things make big things happen.” –John Wooden

The Procedure

First, to move a Magento store from one location to another, make a copy of the directory. If desired, a compressed copy can be made. Second, dump the database to a file. Disabling foreign key checks may be needed. If the database is dumped already, then open the files and add the following:

Third, edit the following file:

Then, using a MySQL administration tool, update the following entries in the core_config_data table:

Ensure that the vhosts file at the destination is correct and includes the following:

Update the pear.ini file in the downloader/pearlib folder with the new paths.

Delete everything in var/cache.