Magento on new server redirects to old server, still points to old server after using phpMyAdmin to change Base URLs, and may even still redirect to old server after cleaning out the Magento cache.
Yep, been there, done that…
To make changes in core configurations and have them stick (local.xml, base urls, etc.) you need to clear your Magento code cache, often by actually manually deleting the mage--? subfolders in var/cache.
Cached configuration can cause all sorts of headaches including having the base urls still pointing back to the original Magento installation (different folders, different server) despite the fact that you can use phpMyAdmin and see that the rows have been updated in the database. Configuration will not be reread from the database until the cached configuration information is deleted.
Another place where stuff gets stuck is in your APC op-code cache if you’re using it. Use the apc.php administration page to clear that as well.
And last of all, IF YOU DO NOT HAVE PERMISSIONS SET PROPERLY ON var/cache AND var/tmp SO THEY’RE BOTH READABLE AND WRITEABLE TO YOUR WEB SERVER, Magento may store the cached information in the system /tmp directory which means that no amount of clearing Magento’s cache will make the cached configs go away until someone reboots the server, the system /tmp directory gets cleared and Magento seemingly automagically reads its configs. See images below, carefully read the directory paths in the top bar, notice that they are in the system temp, not in Magento’s var/cache off its home directory.
In this case, you will need to clear the cache Magento has created in /tmp. Look for /tmp/var/cache/* or /tmp/magento/var/cache/* or similar. Also there will be Zend* files stored there. They will have to be deleted. If you are managing your own server, this is quite simple, if not, you will need your hosting provider to hunt them down and delete them. See the images below for their location as noted in a live situation where this redirect was happening.
Set your var/ folder structure to chmod 777 to prevent this from happening. In fact, when transferring Magento from one server to another, the first thing after restoring the files should be a sweep through the files setting the permissions after which chmod -R 777 both var/ and media/.
Click thumbnail to see full-size image