If you have ever had to move a Magento site from one domain or server to another, you’ll likely already be familiar with just how tricky this process can be. In this article, we’ll talk you through the different processes and steps involved in successfully completing the Magento 2 migration process.
Package Up/Download Your Site Files
You should definitely consider using your ‘site backup’ feature here for two different reasons. Firstly, using this feature means there will be less to download. Secondly, you can be sure that you have all of your important files intact when it comes to deploying your Magento 2 site on the other end.
If your current host does not offer this feature, you will also be able to manually download your files. With this option, it is vital that you check you have everything and that no errors occurred during the downloading process.
Also, if you currently have shell access to your current server, you can also use this option to download all of your files on one easy download. This option makes it a lot easier for you to deploy your files to the new server. It also makes sure that none of your files are corrupt.
Once you have your package downloaded, you can then deploy this to the new server.
Make Sure to Take a Backup of Your Original Site’s Database
Using the PHPMyAdmin, you can them take a full backup of the site database that Magento was using. Typically, this should be in the form of a .sql file. It’s vital that you take a complete backup of all the tables in your database. If your current database is particularly large, then use compression when exporting the database. This will help you keep within the file upload limits.
Update Your Live Site URL Data
Again, working in PHPMyAdmin on your target server, all you will need to do is import your saved SQL file into a new – and empty – database. Once you have completed this step, you will need to update the live site URL data. This needs to be done in two places. You will need to open PHPMyAdmin and find the table labelled ‘core_config_data’. You will then need to search for two rows that end in ‘base_url’.
Update Local.xml With New Configuration Details
It’s easy to locate your local.xml file in the app directory. Once you have found this file, you will need to look through the file until you see the database connection information. Here, you will need to change the current values in the square brackets after the CDATA tags. You will be changing the values to your new server settings. Also, make sure to save the file after you complete this step.
Delete Cache Data
Lastly, you will need to locate your ‘var’ folder. Once you have found this folder, you will need to delete its entire contents.
These steps should help you to complete the Magento 2 migration process successfully. Let us know about your Magento migration journey in the comments below.