If you are a Magento developer sometimes you need to move the Magento eCommerce shop from one host server domain to new host server domain or from one directory location to another directory location. Migrating Magento to a new server is a simple task once you know how to do it. This “How to move Magento from one server to another” post will outline the steps involved to successfully migrate a Magento website.
FIRST METHOD
- Back up the files in the test server.
Go to your test site admin backend and refresh Cache by System > Cache Management. Then download and save the whole magento shop root directory via File manager or FTP tools. - Export the magento Database.
Enter your server control panel phpmyadmin database area and EXPORT your magento shop database in to “name.sql.zip “format. - Move magento files to the new server.
Upload the root directory (all the files) of your test magento shop backup taken on the step 1 in to the new server domain folder. - Import the database to the new server.
Go to your new host account phpmyadmin and create a new database, database user and database user password. Then open the database sql file saved on step 2 with a text editor and edit the database name mention in to the new database name, save it. Then import the “name.sql.zip “database backup saved on the step 2 in to this new database. - Update the database details file.
Next step is to edit the database details file. To do this go to magento live site folder, find out “app/etc/local.xml” file and enter the latest Database details which is created on the step 4. - Modify the base URL database table.
Next is to replace old server domain name with new domain name. For this go to your new server phpmyadmin magento database and modify core_config_data table as shown below.- web/unsecure/base_url > http://www.newdomain.com/
- web/secure/base_url > http://www.newdomain.com/
- Refresh cache and Reindex Data.
The final step is to clear the cache. Go to your sites admin panel (Login with the test site username and password) System > Cache management > Select all & disable cache management. Then navigate through System—>Index Management. Select fields in Status — ‘REINDEX REQUIRED’, then choose ‘Reindex Data’ from drop down and click Submit or delete all the files in “var/session” and “/var/cache” folders of new site.
Take a look to your new magento ecommerce store frontend.
SECOND METHOD
One problem on this method both magento setups must be the same version
- Go to your test site backend and refresh cache by system > cache management. Then take a backup of test site phpmyadmin database by exporting database in to “dbname.sql.zip” format (or any suitable format).
- Next is to take a backup of below folders on the test site to your system
- Contents inside frontend folder (app\design\frontend)
- Contents inside frontend folder (skin\frontend)
- Catalog & other required folders (media\catalog)
- Install a new magento store in to the new server.
- Go to the new server phpmyadmin database and delete all the tables.
- Unzip backup database on the first step “dbname.sql.zip” and import “dbname.sql” file to the new database.
- Copy below folders to their respective new magento server directory
- Contents inside frontend (app) folder to app\design\frontend.
- Contents inside frontend (skin) folder to skin\frontend.
- Catalog & other required folders to media\catalog, xx\
- Edit base URL mentioning table (core_config_data table) on the new magento.
- web/unsecure/base_url > http://www.newsite.com/
- web/secure/base_url > http://www.newsite.com/
- Go to your sites admin panel System > Cache management > Select all & disable cache management. And also index data by go to System—>Index Management. Select fields in Status — ‘REINDEX REQUIRED’, then choose ‘Reindex Data’ from drop down and click Submit.
Check your new magento store…