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:

SET FOREIGN_KEY_CHECKS=0

... dump contents ...

SET FOREIGN_KEY_CHECKS=1

Third, edit the following file:

app/etc/local.xml
  
    

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

web/secure/base_url
web/unsecure/base_url

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

  Options Indexes FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  allow from all

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

Delete everything in var/cache.