Knowledge Base
MilesWeb / How-Tos

Learn to Move Your Magento Store From One Server to Another

Approx. read time : 2 min

It is very difficult to move any kind of application between servers. Even with Magento you face lot of challenges. Therefore, here’s a step by step guide to learn about moving your Magento online store from one server to another.

When you transfer a Magento website there are some things that you need to worry about as compared to downtime. Let’s check the steps.

Prerequisites

  • Root access to both servers
  • cPanel or knowledge on creating virtual host on the new server

Step 1. Inform the Store Administrators About the Transfer

Firstly, inform the Magento administrators to stop working on the store. Or else, things might get lost in the process.

Step 2. Create An Account on New Server

Using the same username for user, create an account on the new server where you are going to transfer your store.

Step 3. Create New databases and Users on the New Server

On the new server after logging, create new databases and users by replicating settings from the old server.

You will find this data in your document root (on old server) for Magento within app/etc/local.xml.

Step 4. Backup public_html folder

Then you need to take the backup public_html folder by going to your account:

Step 5. Dump Databases from Old Server

Now, dump database(s) from old server using the mysqldump option for taking the backup of your database instantly.

Step 6. Move Databases to a New Server

Move the archive.tar.gz, and databases to the new server using scp as below:

Step 7. Import the Database Backup

Next, just import the database backup from the dump file. Sometimes it is difficult to import the dump of the database using PMA. So, it is better to upload database to a server and import it via command line interface (CLI).

Use the below command to import database with CLI:

Step 8. Configure New Server public_html

You need to configure new server public_html using the below command:

Step 9. Create a New Subdomain

Create a new subdomain and modify your Magento install to load from this domain.

In your cPanel, create subdomain: new.yoursite.com

Then go to PhpMyAdmin and edit database core_config_data and change yoursite.com to new.yoursite.com for path: web/secure/base_url and web/unsecure/base_url

Step 10. Getting 500 Error

If you are getting 500 error, go to public_html dir, and run the below two commands:

Step 11. Ensure Your Website is Working

Ensure that your website on new.yoursite.com is working properly

Step 12. Redirect DNS

Redirect your DNS by running Rsync from current server to ensure that all your files (especially session) are in sync with the new server as below:

That’s it! You have learned to move your Magento store from one server to another.

Also Read:
Learn to Transfer Magento Website from Localhost to Server
Learn to Enable and Disable Magento Maintenance Mode

Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.
Need help? We’re always here for you.