Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moved magento site to another host, redirecting to the old site

We have moved out magento site to another host. But it is redirecting to the old site

We did following changes before moving the site

1. DB backup
2. files are zipped and copied to another host.

after moving the site to another host

1. changed the /web/secure and /web/unsecure values in the DB.
2. In magento files /app/etc/local.xml changed the database name.
3. cleared the var/cache
4. cleared the var/tmp
5. cleared the var/session.

but still the magento site is redirected to old site.

Can any one help me with this.

Thanks

like image 1000
Sai Kumar J Avatar asked Oct 03 '14 11:10

Sai Kumar J


1 Answers

Several steps involved in cloning or moving a website.

NOTE: It's common practice to empty the var/cache, var/session directories before copying to new location. Clearing cache is mentioned below as it's necessary to clear the cached config after you've run through the list and properly set database access, BaseURL, etc.

  1. 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.) Note: more sophisticated Magento admins use rsync, it's far easier.

  2. (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.

  3. Make sure app/etc/local.xml points to the proper database and make sure if you back up the original local.xml that it doesn't end in .xml -> needs to be something like local.xml.sv1

  4. Change your database entries Unsecure BaseUrl for and Secure BaseURL to point to your new location (http://www.example.com and if ssl cert installed https://www.example.com respectively). Use phpmyadmin to look for the paths web/unsecure/base_url and web/secure/base_url in the core_config_data table. (Note: entries will exist for each scope set, minimum is Global)

  5. Manually clear your cache by deleting all the mage--? subfolders in var/cache

  6. 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.

  7. 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.

like image 68
Fiasco Labs Avatar answered Nov 01 '22 18:11

Fiasco Labs