The process of migrating a Magento web store from old host to a new one can be a challenging task, especially for those who are doing it for the first time. All the steps included in the Magento migration are not as difficult as you think, but still, you need to be very careful while performing it.
Well, the reason behind the Magento migration could be anything. It can be due to the shortage of bandwidth and disk space or you may need a more reliable and upgraded server that can protect your web store. Whatever the reason is, it is always essential that you perform the migration process correctly, otherwise, you could trap into a stressful situation.
To help you with this process, we bring you the step-by-step guide that will simplify your Magento store migration from one host to the another. But before this, make sure you choose a reliable web hosting service provider that can offer you sturdy web hosting plan, security services, backup and restore functionality, a huge disk space and bandwidth and other key features that can help you grow your web business. Once you are done with a selection of your new host, you can begin the process of Magento Migration:
1. Backup your Magento files and database
Before you move your site to the new server, make sure you create a full backup of your existing Magento database and file system. To backup your Magento store, trail the following steps:
Tip: Make sure that you test all the changes if you want to finish the migration process effectively and efficiently.
2. Transferring the Magento Filesystem
Once after creating a backup, you will need to transfer all your files either to the testing server or on your local machine.
If you have an access to FTP, you can easily copy the Magento files to another location. Well, there is another way to do this. For that, you need to access your Magento admin → go to System → Tools → Backups and run a System Backup.
If you are comfortable with the coding, you can use the following piece of line to clone your files to your local machine:
Tip: Transferring an entire Magento store to the local machine can take hours to complete the process, especially if your store has hundreds and thousands of products.
3. Migrate your Magento Store to a New Host
This step is all about moving your Magento shop to a new hosting environment.
So, first, we will move the filesystem of a Magento store. For that, you will need to move the files into the document root. If you are not sure about it, you can also put a simple html file in the document root to check whether it can be browsed or nor.
Tip: Here, you’ll need to use your server’s IP address because you haven’t migrated your domain name yet.
Now, access the app/etc/local.xml to submit the precise database details in the following boxes/sections:
You will need to tweak the HOSTNAME, USER, PASSWORD, and DATABASENAME with the new one and don’t forget to save the changes.
The next step is to insert the database into the new server. You can import it either through PHPMyAdmin or use the following piece of a command line:
mysql -h HOSTNAME -u USERNAME -p DATABASENAME < BACKUPFILE.sql
Tip: To make your files lighter, you can remove the /var/cache & /var/sessions files. This will help you move your database quickly and easily.
4. Change the DNS Settings
This is the final step in Magento migration. In case, you are getting a new domain name, you will need to tweak the references to the old one.
For that, access the core_config table and by ‘path’ place the new URL into the field of web/insecure/base_url and web/secure/base_URL
If you are using the same domain name, you will need to point the DNS system to your new host to let the people find your Magento store on your new location instead of your old one. To do this, you will need to login to your domain name provider and access the management area. Now, you can make changes to the IP of your new hosting provider.
Well, this can take more than one day, so it would be better to put your old e-store to the maintenance mode. This will restrict the people from accessing your old location. Once after changing the DNS settings, your web visitors will be redirected to the new host.
So this is how you can move your Magento store to the new host. The process is very simple. All you need to do is to follow each and every step very carefully and change the DNS settings of your Magento web store.