rss
twitter
    Find out what I'm doing, Follow Me :)

Tuesday, November 24, 2009

Pin It

Widgets

Moving Magento sites

When you're moving a Magento site from one domain to another, you will run into the problem of the old domain still being used. To actually use the new domain, the MagentoTM configuration needs to be changed.

Instead of a configuration XML-file the right place to look for is the database. Within the database table "core_config_data" there are two values pointing to the current domainname: "web/unsecure/host" and "web/secure/host". Both need to be changed.

Either login through a tool like PhpMyAdmin or open up a SQL console, and cut-and-paste the SQL commands below. Replace the word "DOMAIN" with the actual domain you're using.

update core_config_data set value="http://DOMAIN/" where path=’web/unsecure/host’;    
update core_config_data set value="http://DOMAIN/" where path=’web/secure/host’;

Unfortunately Magento is very fond of caching, so we also need to flush the cache. Only after the cache is flushed . For this to work you will need to delete the contents of the Magento-folders "var/cache/" and "var/session/". Hopefully you're a Linux geek as I am, so you login to your favorite UNIX shell and execute the following:

cd /path/to/your/magento/site
rm -r var/cache/* var/session/*

Cross your fingers and refresh the page.

No comments:

Post a Comment