views:

29

answers:

1

Hi

I want to create another instance of magento for development purposes.

I've copied the site and the database and changed the connction string for the database.

However, when I go to log in to magento it re-directs to the live site www.example.com rather than going to the test url test.example.com.

Both instances exist on the same box.

After a bit of digging arund I think I need to change the root_dir, but not sure where to change this.

Can anyone help?

Thanks Tom

-- Edit --

I've updated the two fields in question in the database, but all urls still point to the production environment.

Do I have to run a specific script to update all of these across the whole site?

-- Edit 2 --

There was more than one instance of the two urls in the table, after updating these and deleting the cache and sessions directories from the var folder everything worked.

+2  A: 

You need to edit the database table "core_config_data". Look for records with a path of "web/secure/base_url" or "web/unsecure/base_url" and you will see where to change the URL. You may need to clear the cache.
You don't need to change root_dir after all since that is automatic.

clockworkgeek
You also need to make sure that you execute `./pear mage-setup` from the new location to reset the paths for `downloader` otherwise you'll overwrite modules in your old (production!) instance next time you use Magento Connect!! To be really safe, delete the .ini files from inside `downloader` before running `mage-setup`
Jonathan Day
To remove the risk of damaging anything on the production site I have created a local copy of the site. At present the only environment I have is windows server running xampp. i have managed to get the site setup and working, but still suffering the same re-direct issue. How would I run the `./pear mage-setup` under windows?
Toggo
I managed to fix this. There was more than one instance of `web/unsecure/base_url`and `web/secure/base_url` I changed all options and deleted the cache and sessions folders from the var directory. It then started working.
Toggo