1) Prior to move, disable the cache, back up your database and pubic_html files and restore to new site.
2) Use phpMyAdmin or MySQL to set the following to your new domain, change https to http if you’re not sophisticated enough to set up a test secure server (not a bad idea to have this capability for preventing serving insecure content when you do template mods):
update core_config_data SET value = 'http://www.example.dev/' WHERE path LIKE 'web/unsecure/base_url';
update core_config_data SET value = 'https://www.example.dev/' WHERE path LIKE 'web/secure/base_url';
3) Change file permissions so Magento has a proper environment to start up in.
4) Finally, change settings in your app/etc/local.xml file so your database login credentials allow Magento to start.
It’s all pretty simple unless you’ve done weird things in your .htaccess, etc. Usually, people get antsy, stuff the database in, load public_html, start Magento and find it redirects to the old site.
The above order tends to prevent that because:
1) No cache being turned on means no old site configs get stuck in cache.
2) Changing the base_url settings before Magento can see the database means that Magento can’t run and store junk in the cache even if you forgot to disable it on the old site.
3) Having the file permissions set properly means that Magento doesn’t go off on a tangent and store its cache in system temp (/tmp) when it finds it can’t write to var/cache/* or var/tmp/*
4) Doing local.xml settings last finally allows Magento to start and any weirdness from this point on is truly weirdness that needs to be addressed, not some dumb config stuck in a dumb place where it refuses t go away.
After the fact removal of unwanted site redirection: (yep, you didn’t follow the above order and it just won’t move to the new site!)
1) Turn off the Magento cache (use phpmyadmin to open core_cache_option table and set all values to 0)
2) Set proper file and directory permissions on your Magento installation
3) Manually clear cache by deleting all the subfolders in var/cache/.
If var/tmp and var/cache permissions are messed up and Magento can’t write there, Magento will write to the system /tmp folder and you will get stuck as this is where Magento will more or less permanently store your cache till the server gets rebooted. Your website will still redirect to the old site because the core_config_data settings are cached in this bogus caching until you are able to force it to re-read the table.
1) core_cache_option table contents,
2 & 3) File listings of Magento Cache storage forced to be in system cache (/tmp) because Magento file and folder permissions (especially var/*) weren’t set correctly on a Magento move.