
Are you planning to migrate your PrestaShop to a new server that you think will offer better services?
This is one of the technical tasks that every online retail shop owner may face at some point in his or her career.
Migrating your PrestaShop store to a new server can be complex, especially if you are trying to do it yourself without any real knowledge about it.
Migrating a shop to a new server is actually not very complicated, but you will need to take into account a certain number of aspects and to follow the steps of the process in the right order so as not to encounter problems on your website.
Here is a little guide that will help you migrate your website to another hosting service, as we have already done in the blog concerning migrating to version 1.7 on this platform.
What do I need to think about when migrating my online shop to another hosting service?
First of all, to move your website, you need to follow these steps:
- Install the FTP client of your choice on your computer to be able to connect via FTP to the new and old server. If you encounter difficulties at this stage, you should contact the helpdesk of the hosting company in question and request the data you need.
- Have an administrator account in the cPanel of your shops, in both the old and new server.
- In addition, you need to hold an administrator account in your PrestaShops' back offices, in the new one as well as in the one hosted on the old server.
How to migrate your PrestaShop to another server, a step by step guide
If you have followed the above steps, the migration can finally begin!
Step 1: put your online shop in maintenance mode
Check the PrestaShop version in which the online store is located and put it in maintenance mode
You may need to update the version your website is currently running on.
If you don't know where to check which version of PrestaShop your shop is in, simply refer to the top bar in your shop's back office.
In addition, although it is not mandatory, we recommend that you put the shop in maintenance mode, so that if someone enters your site whilst you are performing this operation, you will not lose data when migrating your Prestashop store.
If you have a local website, this step is not necessary, since your PrestaShop site is not publicly available on the Internet.
Step 2: create a backup on the old server
To do so, access the control panel of the current (old) server as an administrator, and simply look for the backup module that will allow you to quickly generate a backup of your PrestaShop store.
You will find several backup modules on the official marketplace; these will make your work easier and much faster.
If you encounter problems at this stage, please contact the hosting company's support department. They will quickly tell you what you need to do and where to go to do it.
Once you have created the backup, download it to your computer.
Do not proceed to any part of the migration of your PrestaShop store until you have created a backup.
This way, if a problem occurs during the process, you won't lose your website.
Step 3: download the files from your shop to your computer
First, download all the files from your PrestaShop online store to your computer.
How do I do this?
Simply follow these steps. First, create a new folder on your desktop and connect to the FTP client of your choice, then connect to the current server via FTP.
How do you know you've been successful?
If the connection was successful, you should see a list of folders in the right-hand section.
Once logged in, you will need to navigate to your public directory, better known as the public_html or htdocs folder, and open it.
Please be aware that if you have installed your shop under a sub-directory (i.e. if it has a domain formatted as: www. tuweb. com/store), you will need to search for the corresponding directory and open it.
Select all of the files (ctrl+A/cmd+A) and drag them to the folder you created on your desktop to start downloading them to your computer.
This process can take a few minutes, depending on the number of files and their contents.
Once all of the files have been downloaded from your PrestaShop store, a notification will appear to inform you that the file transfer is complete.
Step 4: export your shop's database
Once you have transferred the files to your computer, return to the current server's cPanel and look for the phpMyAdmin module (phpMyAdmin is a tool for database management that is written in PHP; it allows you to create, delete or modify SQL database data).
Once opened, you will find a list of all the available databases on the left-hand side. Select your current shop's database.
A list of tables will then appear on the right.
Click on "Export" to start downloading your database.
Keep the default options selected and continue.
Your browser will then start downloading a zip file containing a copy of your PrestaShop database.
Step 5: Create a new database on the new server
Access the new server's control panel as an administrator, locate the MySQLDatabaseWizard module and follow the steps to create a new database.
Choose a name that clearly differs from your old Prestashop site's database.
Step 6: import the database from the old shop to the new server
Locate the phpMyAdmin module again on the server.
Open it. You will find the list of available databases in the panel on the left. Select the one we created in the previous step.
Click on "Import" in the panel on the right and select the file we downloaded in step 4.
You will receive a notification when your PrestaShop database has been correctly imported.
Step 7: download the files from your shop to your server
Return to your FTP client and connect to the server of your choice.
Navigate to the public_html directory if you want to install your shop in the site's root folder. If you prefer to install it in a sub-folder (for example www. tuweb. com/store), create the corresponding folder inside the public directory and open it.
Drag the files from your computer (the ones we copied in step 3) and drop them in the corresponding directory on the new server.
Again, this process may take a few minutes.
Step 8: modify the config/settings.inc.php Prestashop files
Find the config/settings.inc.php file in your FTP client, open it and edit the lines underneath.
This PHP file must be updated with the information provided by the hosting company and the information we have selected to set-up our PrestaShop program:
- DB_SERVER: database server.
- DB_NAME: name of the database (chosen in step 5).
- DB_USER: the user associated with the database.
- DB_PASSWD: the user's password.
Save the folder and upload it to the server.
Step 9: check the permissions/authorisations
Before checking that the new shop is working properly, you must make sure that the files and directories have the required permissions.
You should always verify these authorisations with your hosting provider. As a general rule, these authorisations are as follows:
File permissions: 664
Directory permissions: 755
If you have problems loading images, try setting the permission to 777.
Step 10: Empty the cache
Ideally, you should empty your page's cache and force the page to be indexed again to make sure everything is working properly.
Please note that if you ignore this step, you may see the data from the old page stored in your browser's cache, and if a problem occurs, errors will not appear.
To correctly empty the cache, delete the contents of the folders /cache/smarty/compile and /chache/smarty/cache, except for the index.php file in each of these folders.
Step 11: Deactivate maintenance mode
Access your website's Prestashop back office and disable your shop's maintenance mode.
We then need to enter our domain to verify that our website is working properly.
If this is the case, the migration process from Prestashop to another hosting is completed. Your shop is now available on your new server.
Conclusion
Did you have difficulties migrating your PrestaShop to another hosting service?
I'm sure that's not the case, because as you can see, although there are some rather technical and delicate steps, it's generally not as complicated as it used to be, especially since you have several specific modules to guide you through the process. You don't need any highly technical knowledge to do this.
I encourage you to try with your own online store!
Imagen principal By Freepik.