Changing your Magento store’s URL in the database

If you need to change your Magento store’s URL through your database, it can initially be baffling to know where to start. Here’s our quick guide to updating your Magento site URL through the database.

Firstly, open your Magento’s database (we use phpMyAdmin for this), and update the following rows to your new store’s URL in the core_config_data table:

  • web/unsecure/base_url
  • web/secure/base_url

Be very careful if you have Magento configured for multisite (multiple stores in the same installation)! There’s a guide on Magento’s website which gives the same result with a slightly different method, too.

Updating your Magento store’s URL setting in the database can cause problems with accessing your administration panel; we’ve written another post on fixing Magento’s admin panel redirecting to your store’s homepage, just in case. Luckily, it’s really just a case of  deleting the contents of the following directories in your Magento installation:

  • /var/cache
  • /var/session