How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

Procédure

Why migrate to Nginx?

Nginx is a well-known web server that is gaining in popularity every day. It replaces the Apache web server. It is a great success with connoisseurs and is currently supported by a very active community. It is well maintained and, if properly mastered, offers many advantages over Apache in terms of performance.

Before you can migrate your site, make sure you have the following information:

  • the name of the site database
  • the site database user name and password

How do you back up the web files of your Prestashop shop on the ISPCONFIG Apache VPS?

To save the web files of your Prestashop site on the ISPCONFIG Apache VPS, you need to connect to your site using FTP. So to start with, you should make sure you have an ftp account that will allow you to back up your site.

If you need to change the FTP account settings for your site within the ISPCONFIG Apache VPS, follow the procedure below:

Log on to ISPCONFIG --> Sites --> FTP user --> FTP user name

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

You can also create a new ftp account under ISPCONFIG to perform the backup.

Once you have the ftp connection settings for your site, you can use your ftp client software to connect to the site inside the server. For example, with "FileZilla", you would need to open the application, and specify the connection parameters which are :

  • the server name or hostname in the form vpsxxxxx.serveur-vps.net or vpsxxxxx.lws-hosting.com
  • the ftp username for your site (this is the parameter that will allow you to connect to the appropriate site within vps)
  • the password of the ftp user
  • you can also specify the port, but this is not essential as it is the default port used on the server (port 21).

After that, you can click on the quick connect button and the connection to your site will be made. Information about the connection will be displayed on the Filezilla interface.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

You will be greeted by a certificate validation window that you should confirm.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

Once the connection has been made, you will find the list of directories linked to your site in the interface dedicated to the remote site (on the right). And on the left, you'll find an interface dedicated to the local site , which will contain your local files in the current active directory.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

Your site's web files are in the web directory. Double-click on the directory to enter it.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

You will then see a list of your web files in the remote site.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

Then, in your local directory (on the left), navigate to a folder where you want to store your backup. Create a new folder if necessary.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

Once your site backup folder has been created, you then need to select all the web files on the remote site.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

Finally, right-click on the selected files and click "download" to download them to your computer in the open local directory.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

Wait until the download is complete and you will have a backup of your site's web files.

How do you export your site's database?

Before exporting your website database, we recommend that you set your shop to maintenance mode to ensure that all recent orders are taken into account when you migrate
.

To export your site's database, you'll need to connect to your VPS's phpmyadmin interface following the procedures outlined in this article"How do I connect to the PHPMyAdmin utility from ISP Config?".

You will probably need to know the name of your site's database, the database user name and the password before you can access it.

Then, once you are on the phpmyadmin interface, you need to :

  • click on the database in the left-hand menu, go to the "Export" tab at the top,

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

  • and finally, click on the "Export" button to download your exported database in sql format.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

How do I recreate the site and its database in the ISPCONFIG Nginx VPS?

To recreate the site and its database in the ISPCONFIG Nginx VPS, you now need to connect to the ISPCONFIG interface of this VPS.

1. Connecting to ISPCONFIG

Connecting to ISPCONFIG with the Nginx VPS is similar to any VPS with ISPCONFIG. You can follow the instructions in the article"How do I access ISPConfig on my dedicated VPS server?" to connect.

You will be greeted by theISPCONFIG authentication interface if you are not yet authenticated. Authenticate with the admin user and you will arrive at the home page.

2. Creating a new client

Once you have logged on to ISPCONFIG, you can add a new customer via the customer menu. Type in the information and save so that the customer can be created.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

3. Creating the site in the new Nginx VPS

After that, to recreate your site, you need to go to the "Sites" menu on the top menu, and then click on the green "Add a new site" button.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

Enter your site parameters very carefully:

  • the site name must be exactly the same
  • the value of "auto-sub-domain" should also be the same
  • keep the same php version used to avoid incompatibilities unless you are sure that the php version you are going to use is compatible with your site
  • Don't activate the Let's Encrypt certificate yet, as it requires DNS pointing to be set up.
  • And register

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

Once you have registered, the site will be created after a few minutes, and you will see a red light at the top, indicating the number of tasksISPCONFIG is running to apply the changes.

4. Creating the database in the ISPCONFIG Nginx VPS

The next step after creating the site is to create the database for your site.

Recreate your site's database by following the procedure mentioned in this article"How do I create a database using ISPConfig?"

Properly reproduce the information in your site's database:

  • the database user and password should be exactly the same
  • the name of your site's database should also be the same
  • reproduce the same settings as your old database

How do I import the site's web files into the ISPCONFIG Nginx VPS?

To enable you to upload the web files you have just saved via FTP, you will need to create an ftp user in your ISPCONFIG Nginx VPS server. Follow the instructions in this article"How do I create an FTP account in ISPConfig?" to create an ftp account for your site.

Once your ftp account is created, you can connect to the site in the other VPS, using your preferred ftp client software.

When you are connected :

  • open your site's backup folder on the local site
  • on the remote site, open the "web/" directory
  • Select all the locally backed up web files on your site
  • Right-click on the selected files and click on "Send" to upload the web files to the new server

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

How do I import the database for the new site into the ISPCONFIG Nginx VPS?

The database for your site can also be imported using the phpmyadmin utility on the ISPCONFIG Nginx VPS. As with exporting, you need to connect to phpmyadmin on the Nginx VPS.

Warning! The ports used for phpmyadmin on an ISPCONFIG Apache VPS and an ISPCONFIG Nginx VPS are different
.

On the Nginx VPS, you will need to access the phpmyadmin url. This is communicated in the VPS delivery email, and is in this form:

"https://vpsXXXXX.serveur-vps.net:8081/phpmyadmin"(XXXXX being the vps number)

Once on the first authentication, type :

  • "root" as the user name
  • and enter the ISPCONFIG admin password in the password field
  • Confirm

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

This will take you tophpmyadmin authentication, where you must enter the access details of the database user you have created for the site.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

Next, to import the database: select the database --> click on "Import" --> click on "Choose a file" .

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

Choose the sql file of the exported database in your local directories, navigate down and click the "import" button to start the import.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

The import time will depend on the performance of your internet connection and the size of your database.

How do I make adjustments to the site configuration so that it works properly?

On a configuration with Nginx, you should make adjustments to your site settings so that the basic redirections defined on Prestashop comply with Nginx syntax.

Warning! It is not recommended to use .htaccess files on Nginx, which means that the redirection parameters and directives on your shop's .htaccess file should be adjusted to its syntax and added via the Nginx directives on ISPCONFIG
.

Before you can define the redirections, you need to note the link to your shop'sadministration interface. This link takes the following form:

https://nomdelaboutique.tld/adminxxxxxxxxx (xxxxxxxxx being a random sequence of characters generated by Prestashop just after the shop is installed)

Note the last part"adminxxxxxxxxx" because it is different on each site.

To define redirections, you will need to add options in the site settings on ISPCONFIG, following the procedure below:

  • Connect to ISPCONFIG on your Nginx VPS
  • Navigate to : Sites --> Site name --> "Options" tab --> "nginx Directives" --> "nginx Directives" --> "nginx Directives" --> "nginx Directives".
  • And add these lines :
rewrite ^/(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$1$2.jpg last; rewrite ^/(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3.jpg last; rewrite ^/(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last; rewrite ^/(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1/$2$3$4$5.jpg last; rewrite ^/(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1/$2$3$4$5$6.jpg last; rewrite ^/(\d)(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last; rewrite ^/(\d)(\d)(\d)(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg last; rewrite ^/(\d)(\d)(\d)(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/c/([\w.-]+)/.+\.jpg$ /img/c/$1.jpg last; # AlphaImageLoader for IE and FancyBox. rewrite ^images_ie/?([^/]+)\.(gif|jpe?g|png)$ js/jquery/plugins/fancybox/images/$1.$2 last; # Web service API. rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; # Sandbox installation. rewrite ^(/install(?:-dev)?/sandbox)/.* /$1/test.php last; location / { try_files $uri $uri/ /index.php$is_args$args; } location /adminxxxxxxxxx/ { if (!-e $request_filename) { rewrite ^ /adminxxxxxxxxx/index.php last; } } # .htaccess, .DS_Store, .htpasswd, etc. location ~ /\. { deny all; } # Source code directories. location ~ ^/(app|bin|cache|classes|config|controllers|docs|localization|override|src|tests|tools|translations|var|vendor)/ { deny all; } # vendor in modules directory. location ~ ^/modules/.*/vendor/ { deny all; } # Prevent exposing other sensitive files. location ~ \.(log|tpl|twig|sass|yml)$ { deny all; } # Prevent injection of PHP files. location /img { location ~ \.php$ { deny all; } } location /upload { location ~ \.php$ { deny all; } }
  • Then save. The changes will take effect after a few minutes.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

Warning! All directives containing the"adminxxxxxxxxx" part of the link to the administration interface should be replaced by the one you noted above
.

Once you have carried out all these procedures, all that remains is to point your domain to the ISPCONFIG Nginx VPS.

How do you point your site's DNS zone to the new VPS server?

The last part, DNS pointing, will depend on your DNS configuration. To point your DNS, you need to know where your domain's DNS zone is managed.

  • If it is managed via the other ISPCONFIG server with Apache, you have two options:

1. you can directly update thetype A record of the domain in the ISPCONFIG Apache VPS

  • Log on to ISPCONFIG
  • Go to the DNS tab
  • Choose the DNS zone for your domain in the form "mydomain.tld".
  • Among the records, click on thetype A record for your site in the form "mydomain.tld."
  • Update the value of theip address by replacing theip address of your old server with that of the new one.
  • Save
  • Repeat the same procedure if your domain 's www record is also of type A

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

2. or recreate the DNS zone on the Nginx VPS and update the main and secondary DNS servers following the instructions in this article "How do I create a DNS server in ISPConfig on a dedicated VPS server?".

  • If it's managed via another paneau, you'll need to connect to your domain's DNS zone management interface to change theip address.

Once the settings have been applied, all you need to do is wait for the DNS propagation time and your site will be migrated to the new server.

How do you reinstate the Let's Encrypt certificate on your site?

After that, you can create a Let's Encrypt certificate on the site that has just been migrated by accessing the ISPCONFIG interface of the Nginx VPS, checking the "Let's Encrypt " option via the site parameter, and finally saving.

How to migrate a Prestashop site from an ISPCONFIG Apache VPS to Nginx

The Let's Encrypt certificate will be installed after a few minutes.

After that, you can finally remove the maintenance mode so that your customers can visit your site again and place orders
.

Conclusion

You are now ready to migrate your Prestashop site from an ISPCONFIG VPS with Apache to an ISPCONFIG VPS with Nginx. If you would like to take advantage of our team's expertise to carry out the migration for you, don't hesitate to "outsource" .

Rate this article :

5/5 | 2 opinion

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

2mn reading

How do I add a website to an ISP Config VPS dedicated server?

1mn reading

How do I create a sub-domain on a dedicated VPS server?

1mn reading

ISPconfig - How do I link my domain name to my VPS server?

1mn reading

It's easy to configure my domains on my VPS


Ask the LWS team and its community a question