Changing base_url in Magento Database
It is sometimes necessary to change the base_url value in the Magento database, if for some reason you can’t access the Magento backend. For inexperienced users it can be quite difficult to find. Here’s the process in 3 easy steps:
1. Find the table core_config_data
You need to edit the field value, you’ll see it contains the domain names as both web/unsecure/base_url and web/secure/base_url.

2. Edit Value Field
You need to replace the two URLs with the new domain name. Click on the pencil icon to do this, and click ‘Go’ (if in PHPMyAdmin) to update.
3. Clear Cache
You can either do this in the Magento backend, or if this is not possible use FTP to clear the contents of the var/cache and var/session folders.
