We're using Magento Community edition version 1.7.0.2
When we clone, the cloned site always redirects from the clone back to the live site.
We've tried the following two cloning methods:
– using the Clone button in cPanel's Installation to produce a clone on the same server
– porting the entire site to another server
We encountered the same redirect problem with both methods.
How can we stop it from redirecting back to the live site?
Best Answer
Several steps involved in cloning or moving a website.
Copy application files to new location and import database into MySQL. (best to do this with a tarball and database dump sql file, ftp has issues with things like getting .htaccess files to transfer, case to matter, etc.)
(important!!) Make sure file/folder permissions and owner/group are correct so that var/ folder system is writable. Otherwise the Magento cache gets written in system /tmp instead of Magento var/ and only a server reboot or manual deletion will clear Magento cache out of /tmp . Also, not having var/ writable means that any drastic errors that write a file to var/report/ will fail to write any stack traces, compounding your installation heartburn.
Make sure
app/etc/local.xml
points to the proper database and make sure if you back up the originallocal.xml
that it doesn't end in.xml
-> needs to be something likelocal.xml.sv1
Change your database entries Unsecure BaseUrl for and Secure BaseURL to point to your new location (
http://www.example.com
and if ssl cert installedhttps://www.example.com
respectively). Use phpmyadmin to look for the pathsweb/unsecure/base_url
andweb/secure/base_url
in thecore_config_data
table.Manually clear your cache by deleting all the
mage--?
subfolders invar/cache
If you were using the compiler on the previous site, disable compiler with SSH command line
php shell/compiler.php disable
from the Magento root.Attempt to load your admin backend, you should be on the new server URL now.
Following these steps should clear all the hiccups that cause Magento to adamantly redirect back to the old server. And believe me, I've had them all happen.