This article explains how to migrate Magento Store to another server. As a company, there is always a time when you need to migrate. There are many reasons for you to migrate from the Magento store to another server. For example, you might be tired of your service provider. You might want to move from the dev environment to production … Whatever your reasons, follow these steps by step guides.
You don’t necessarily need to know much about Magento to migrate Magento. However, you need to understand a little about PHP, MySQL and server configuration.
Steps to migrate Magento Shop to another server
Before you start the migration process, you need to take into consideration the Magento Server Configuration Requirements. In fact, for Magento to function properly on a server, there are some details such as the server performance, the PHP & MySQL versions… that need to be handled. Depending on the version of Magento you are using, I will advise you to read the documentation of Magento to find out more about prerequisites.
I will also advise doing that out of production hours in case your current store is live. If I assume that you have handled all the prerequisites and your new server is ready for the migration, these are the 7 steps to follow.
Step 1: Backup all your files and folders in the root directory
The idea here is to compress all your Magento Files and folder into the right format supported by your server. For example, In my case, I compress it into a .zip or—Tar file. Then, download the new compress file into your computer either by using an FTP transfer Protocol or directly.
Step 2: Create a database dump
From your server, generate a backup of your database in .sql format.
Step 3: Create and upload the files/folders backup the new server
Create the installation folder on the new server and point the new URL to that folder. Upload and unzip the backup (.zip or .tar …) on the folder.
Step 4: Create and import the database
Create a MySQL database on your new server. Note that if you are familiar with creating a database on your server, the process is the same. For instance, most of the database connection requires the database name, username, password, and server name. Once your database is created, import your backup database on the new server.
Step 5: Update new database settings.
You need to change the database settings to be the same as the new information you created in the previous step. If you use Magento 1.x, open the file app/etc/local.xml and replace the username, database name, password and server name with one of your new servers. But if you are using Magento 2.x, open the file app/etc/env.php and update your database information.
Step 6: Update URLs in core_config_data:
Open the database on the new server and look for path =”web/unsecure/base_url” and path=”web/secure/base_url” in the core_config_data table. And then, update URL to your new store URL.
Step 7: Empty var/cache, var/session, var/report, var/log
If you followed those 7 steps carefully, you should access your website with the new URL.
If you planned to migrate the content and keep the URL, you would need to ignore Step 6 and update your DNS to point to the new server. Alternatively, you can migrate your domain name.
Feel free to contact us if you have any question