linux n00b

Migrating Magento to new (sub)domain

Posted in Applications, Howto by downforce on August 12, 2010

UPDATE: Well it turns out this fixes the store, but not the downloader/PEAR updater. More work to figure that one out!

I’ve been trialing Magento on and off for a few years and one day I’ll get my butt into gear to migrate my whole store from Zen Cart (which desperately needs to be patched anyway) to Magento, but I’ve been trying to tie it into a new automated pricing script I’ve been developing (also for a year or so).

I’ve also rationalised my count of subdomains on my domain and moved my old magento development environment from to Previously migrating domains has been a major PITA for Magento but today I decided to screw around in the database and found it to be rather painless!

The database is in the same location with same username/password so all I needed to do was to update the base_url and here’s all I did:

So a few steps, confirm that the two config_data fields are where you want them:

select * from mag_core_config_data where path like 'web/%/base_url';

I have the following output:

| config_id | scope   | scope_id | path                  | value                           |
|        19 | default |        0 | web/unsecure/base_url | |
|        20 | default |        0 | web/secure/base_url   | |

So it was a simple case of updating these values:

update mag_core_config_data set value = '' where path like 'web/%/base_url';

BUT unfortunately it still wasn’t rendering properly. I discovered that the pages get cached! OH NOES!

Oh well, let’s just purge the cache and start again:

#rm -Rf /path/to/magento/install/var/cache

And good to go! Now to upgrade to the latest version.

One Response

Subscribe to comments with RSS.

  1. ajira86 said, on October 5, 2011 at 08:46

    or you can simply refresh base link configuration by removing app/etc/local.xml and restart the installation procedure.

    this procedure will not destroy you personal data, only refresh the links and basic configuration

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: