Migrating PrestaShop to another server is a common thing that many webmasters and PrestaShop store owners need. At Raiola Networks we offer free PrestaShop migration for new customers, but we are going to explain the process to you in case you want to do the migration yourself.

The idea is to migrate PrestaShop to another hosting without having performance or positioning problems, following a structured and very simple methodology.

PrestaShop store is an eCommerce, and when playing with transactional websites, it is important not to make mistakes.

If we already have a backup of our PrestaShop, it is very easy to upload it to the new server, and with that, we will already be halfway there. Remember that to migrate it is important to make a backup of both the files and the database of the online store.

Change PrestaShop hosting

Changing PrestaShop hosting is a common challenge that usually has to be done when the PrestaShop store has grown and you need a new server with more resources to support the traffic.

To avoid having to constantly migrate PrestaShop, the ideal is to move it to a new hosting where the resources are not fair.

Migration of PrestaShop is not difficult, and it is not a bad thing either, but it is not a task that is recommended to be done every day because we will have to put our PrestaShop on pause.

What do I have to take into account to start the migration?

Precisely the first thing you should keep in mind for a PrestaShop migration is that you should put PrestaShop in maintenance mode to avoid problems with customers.

Another important thing: the process is based on making a backup copy of both the files and the database on the current hosting, and then uploading it to the new hosting and importing the new database. The final step would be to change the DNS of the domain and then take it out of maintenance mode when we verify that everything works perfectly on the new server.

If the migration has gone well, everything should be exactly the same as in the old hosting.

How to do a migration step by step?

We are going to follow a step-by-step process to move the PrestaShop files and database to a new server using a previously made backup. We are going to use a generic tool to create backups, but you can use your favorite backup tool without any problem.

As I was saying, before making the backup it is important to put the website in maintenance, so as not to have any desynchronization in sales. Ideally, from this point on, no modifications are made to the database.

1. Put PrestaShop in maintenance mode

We start the process by activating the PrestaShop maintenance mode. We can do this with the native functionality:

We must go to the backend of our PrestaShop store, specifically to “Shop Parameters” or “Store Configuration” and then click on “General”. Then, we click on the “Maintenance” or “Maintenance” tab.

There we deactivate the “Activate store” box so that the store stops appearing to visitors and prevents them from buying since if they buy we could have desynchronization problems when migrating the web.

The screenshot above has been taken on PrestaShop 1.7, but the process is more or less the same for the latest versions.

This step is very important to perform when migrating any e-commerce website.

2. Make a backup of the source server

This is where the variations in the process begin since we can use a backup module or a server-level service, such as the Installatron application auto-installer that we offer in the Raiola Networks PrestaShop hosting plans.

I am not going to teach you how to make a backup of the store files and a copy of the database, since this is a separate post, but remember that when migrating a Prestashop from one hosting to another hosting it is very important that you do not leave any files behind and that the database copy is correctly made.

It is always better to zip at the source hosting and unzip at the destination server, instead of unzipping on your computer and uploading the files via FTP.

With the database, there is less of a problem since we can use phpMyAdmin or a similar tool to carry out the process flawlessly.

Remember that the modules to make backups or migrations are usually paid. However, at Raiola Networks we offer you a completely free tool to make these backup copies in the fastest and most automated way possible.

3. Upload the PrestaShop files to the new hosting

The next step is to upload the files or, as I said before, the full backup to the new hosting (to unzip it directly on the server).

It is important to pass ALL files. The cache folders do not matter, since they will be regenerated on the new server

We are not going to upload the database yet; We will do it in the next step, using a specific tool for it. In addition, it is important that the database is not included in the CMS files that we upload, since someone may download it and steal sensitive content from us. It’s not common, but it can happen.

4. Create and import the new database

When we migrate an application from one hosting to another hosting, it is as if we were doing a manual installation of a PHP CMS. We must create the new database on the destination hosting before importing the SQL file obtained from the previous server.

Here the process varies depending on the control panel or platform that we use. In the case of cPanel, the process is quite simple:

If we use VestaCP (the panel of our optimized VPS servers ), the process is even a bit easier.

Ideally, you should save the connection data generated when creating the MySQL or MariaDB database.

Any web hosting panel has a tool to create MySQL or MariaDB databases (it doesn’t matter) and, on the other hand, any web hosting has phpMyAdmin to import databases.

I leave you a video tutorial where you can see how to import an SQL file (as databases are usually exported and imported) using the phpMyAdmin tool (the most common). Today, we can say that phpMyAdmin is available in 99% of hosting panels .

When importing the database we must take into account the encoding, because if we do not import the database in the same encoding that we exported it, we can have problems and strange characters may be displayed.

With the files, you do not have to be so careful in this regard, but with the database you do.

5. Modify the parameters.php file

One of the most important files in the PrestaShop store is the parameters.php since it stores a large part of the configuration of our CMS.

We can access the parameters.php file in several ways: FTPFileManager, etc.

This file is located inside the folder that contains the online store files, inside “app” >> “config” :

Precisely in this image, you can see the folders using the File Manager of the cPanel control panel that we offer in our shared hosting plans. A File Manager like this saves you the hassle of working with an FTP client like Filezilla and also allows you to easily edit the parameters.php file .

After importing the database with phpMyAdmin, we need to modify this file and insert the database connection data that we generated when creating the new database.

For this reason, I have previously told you about saving the data after creating the database, even though we do not need it to import the SQL with phpMyAdmin.

6. Clear the cache of PrestaShop

Before testing the online store and deactivating maintenance, we are going to empty the store’s cache to avoid inconsistencies when changing servers.

If we have not moved the server cache, as I mentioned at the beginning of this post, we no longer have to do anything. But if we use PrestaShop cache on disk and we have not excluded the cache folders when migrating, we must empty the cache.

To empty the Smarty cache in PrestaShop, we must go to the panel of our store and go to “Advanced Parameters” or “Advanced Parameters”:

There we will have a button called “Clear the cache”, at the top left.

Although we could also clear the Smarty cache directly by FTP accessing the files, I personally do not recommend it.

The PrestaShop Smarty template cache is necessary for the server to function properly and the online store to perform well.

Once the PrestaShop cache has been emptied, we can now test the store and, if everything works correctly, deactivate the maintenance mode.

7. Test the store and disable maintenance mode

We have reached the end. Right now we only need to test that the online store works correctly to deactivate maintenance and offer our products to our visitors and customers again.

Testing if everything works correctly on our new server is a manual process. Ideally, we test the checkout or sale process of our store, as well as the display of the listings and the general operation of the store.

Once everything is fine, we must deactivate the PrestaShop maintenance mode in the same way that we activated it.

If everything is correct, we will have already managed to migrate PrestaShop from the server and we will have everything working correctly on the new server.