Magento, Change Domain
Warning! Before following the instructions in this article, it is recommended that you make a full backup of your site.
To update the domain name of your Magento installation:
Step 1: How To Identify a Magento Database
- Log in to cPanel.
- Go to the File Manager.
- Navigate to the Magento website's document root and look for /app/etc/local.xml.
- In the list of files, locate/local.xml.
- Right-click on the file and select the View option.
- Find the line that says
<dbname><![CDATA[example_database]]></dbname>
. For the example below, we will use knowledg_mgnt2.
Step 2: How to Update Domain of Magento Website
- Go back to the cPanel homepage.
- In the Databases section, click the phpMyAdmin icon.
- In the left-hand menu, select your Magento database, which you've located in Step 1. For this example, we will use knowledg_mgt2.
- Within the table knowledg_mgt2, locate core_config_data.
- Once located, you can either click core_config_data or put a checkmark on it, then click the Browse link.
- Under the path (Config Path) column, look for web/unsecure/base_url and web/secure/base_url. (Currently, the config_id is 6 and 7.)
- Click the pencil icon of each of these rows and change each value with your new domain name.
If the URLs are located in other database tables, additional changes may be required depending on your site configuration. You may also need to empty your /var/cache/ folder before your domain name change occurs.