0

After moving a magento multistore site to the development environment I did following

1)Changed the base urls of all stores secure and unsecure.

2)Cleared cache folder

3)Cleared session folder

4)Checked the .htaccess file

5)Changed the DB in local.xml

6)All folder file permission is 755

Still when I access the dev site url I am redirected to live site.

Mukesh
  • 7,630
  • 21
  • 105
  • 159
  • 1
    Did you followed the steps in that order? No 5 should be the first step. – Emi Jun 30 '14 at 14:24
  • I changed the url first in DB then pointed the application to this – Mukesh Jun 30 '14 at 14:34
  • Oh, I thought you did that somehow from System Configuration. – Emi Jun 30 '14 at 14:38
  • possible duplicate of [Magento - Duplicated live site to a development server but it redirects to live site?](http://stackoverflow.com/questions/8384646/magento-duplicated-live-site-to-a-development-server-but-it-redirects-to-live) – Simon H Jun 30 '14 at 14:55
  • 1
    @SimonH But the answers mentioned there are not helpful – Mukesh Jun 30 '14 at 18:17

2 Answers2

2

This always boils down to we imported the database and application code, and ran the site once before realizing we needed to change local.xml for database access, changed local.xml and ran it again only to have it redirect to the old domain, so we then changed the baseurls and it still redirects to the old domain despite clearing the cache.

Once you've done that, you've cached all your configuration and Magento redirects till you figure out the alternate caching because it's not stored in the normal place because of not getting file/folder permissions set FIRST before even changing database access and baseurl configuration.

Which is a duplicate of this -> https://stackoverflow.com/a/7144268/722112

Moving Magento actually is a snap when you do this in three steps.

  1. Put Application Code in a tarball on old site, dearchive on new site and change file/folder permissions IMMEDIATELY!! Folders => 755 Files => 644 for most servers AND var/ => 777 recursively.

  2. Use mysqldump to export database, reimport on new server and IMMEDATELY run mysql code to change baseurls. -> https://stackoverflow.com/a/6871195/722112

  3. Only after the above, change credentials in local.xml to allow access to new database.

This guarantees that Magento will put its cache in the proper location on first run, not in system /tmp where you likely cannot access it to delete it and clear cache so you end up with the amazingly undying magento cache that redirects to the old domain and stays around till server reboot.

Community
  • 1
  • 1
Fiasco Labs
  • 6,457
  • 3
  • 32
  • 43
1

I pointed the application to a non existing DB after making changes in the local.xml and cleared caches and reverted back the local.xml file. It started working for me.

Mukesh
  • 7,630
  • 21
  • 105
  • 159