Transfer Magento Site From One Host To Another



Suppose you have developed a website in Magento on the testing environment and it is completed now, you want to live this website on the live server. Suppose your testing environment url is http://www.yoursite.com/dev/ and using the diffrent server as well(database) now you want to change this url to http://www.yoursite.com/ as well as the new Database credentials. In this post I am explaining how to do this?. It is very easy just follow the steps given below:

Step 1. Take the buckup of your database.
Step 2. Take the backup of your files.
Step 3. Create the new database (If you want to change the database as well) on your new host
Step 4. Save all the details of the new database like database name,database user name and password.
Step 5. Now upload all the files to you new host/server.
Step 6. Open local.xml for this Navigate to the app/etc/local.xml and open the file in the editor of your choice and change the infomation of previous database with the new database credentials.

	 <connection>
                    <host><![CDATA[hostname]]></host>
                    <username><![CDATA[username]]></username>
                    <password><![CDATA[password]]></password>
                    <dbname><![CDATA[databasename]]></dbname>
                    <active>1</active>
          </connection>

Step 7. Now uploade the old database on the new database.
Step 8. Now go to your new host database open table “core_config_data” and search for the “web/unsecure/base_url” and “web/secure/base_url” for the path column name and change the value of your old host name with new host name as per the example given below:
Old Url
Base Unsecure Url
New Url
Base Unsecure Url
Note : Just do it for the Base Secure Url as well.
Step 9. Remove all the cache manually for this navigate to the var/cache/ and empty the folder.

You have done, now refresh the cache and your site is on the new url with the new host.

Thanks and enjoy the Magento coding.