In this guide we are going to see the various steps necessary to move a local installation (or to another host) in a remote web space, with relative change of domain. This operation is completely identical to that to be carried out to migrate an ecommerce in production from one VHOST to another with a change from old to new domain. We can do this in different ways, including through the Plesk Migrator extension, saving us a lot of work. However, this will hardly be possible if we transfer our work from our local PC to the remote server.

We transfer files via FTP

In the example we are going to create a copy of Tecnoacquisti.com to create a test environment, the first step is to transfer all files to the new hosting space, here we can perform the operation in different ways by uploading all the files via FTP, or - recommended - by transferring a compressed archive to the destination root and unpacking it from the control panel, if we have Plesk or Cpanel , or via SSH if our destination Server does not have it.

We import the DataBase

The second operation to be performed is to import the database, here too there are various systems, but we will use PhpMyAdmin , as it is very widespread and often the only access to the DB we have on economic hosting. In some cases due to UPLOAD limitations, when our DB exceeds 200MB for example, it may be necessary to use an SSH access or Plesk dump import if available.

Regardless of how we import our database, we will need to change certain parameters in some tables such as: ps_shop_url and ps_configuration, changing the name of the old domain with the new one.

PhpMyAdmin is an open source web application distributed under the GPL license and written in PHP, which allows us to manage our MySQL or Maria DB database via Browser.

Let's edit the PrestaShop configuration file

Once the files and databases that make up our PrestaShop installation have been imported, it is necessary to modify the configuration file that contains the DB access credentials. The file in question is: parameters.php which is located in: app / config. We will enter the data provided by our provider or system administrator.

Clear the cache folders

Once the configuration file has been modified, it is essential to delete the cache folders located in: var / cache. The folders in question are prod (relative to the site in production) and dev (relative to the site in debug mode). We can safely delete them, they will be re-created illegally at the first access in the back-end and font-end to our ecommerce. This procedure is also useful when problems occur following updates or module installation. If we don't perform this procedure, calling our store URL will result in a 500 error from the server.

We regenerate Friendly url and robots.txt

We log in to the Back Office and to finalize our migration all that remains is to regenerate the URLs by going to Store Parameters -> General -> SEO & URLs . We also regenerate robots.txt on the same page and then clear the PS Smarty cache , in Advanced Parameters -> Performance .

Now our PrestaShop ecommerce has migrated, it is advisable to activate the debug always in Advanced Parameters -> Performance and carry out registration and order tests, to check that everything has gone well. After the tests, deactivate the debug, your ecommerce is ready to receive the next orders.

Author: Loris Modena

SENIOR DEVELOPER

For Ind Loris Modena , owner of Arte e Informatica , he began working in the IT sector in 1989 as a system engineer in charge of the maintenance and installation of IT systems. He started programming for the web in 1997 dealing with CGI programming in PERL and then moving on to programming in PHP and JavaScript. In this period he approaches the Open source world and the management of Linux servers.

Product added to wishlist