In this video guide, we will look at the various steps necessary to move a local installation (or on another host) to a remote web space, along with a domain change. This operation is entirely identical to what needs to be done to migrate a production e-commerce from one VHOST to another with a change from the old domain to the new domain. We can perform this operation in different ways, even through the extension Plesk Migrator, 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 the files via FTP.

In this example, we will create a copy of Tecnoacquisti.com to create a test environment. The first step is to transfer all files to the new hosting space. We can perform this operation in different ways: by uploading all the files via FTP, or - recommended - transferring a compressed archive to the destination root and extracting 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 perform is to import the database; there are various methods for this, but we will use PhpMyAdmin, as it is very common and often the only access to the DB we have on budget hosting. In some cases, due to UPLOAD limitations, when our DB exceeds 200MB, for example, it may be necessary to use 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, modifying the name of the old domain to 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 a browser.

Let's modify 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 database access credentials. The file in question is: parameters.php which is located in: app/config. We will insert the data provided by our provider or system administrator.

Delete 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 (related to the production site) and dev (related to the site in debug mode). We can safely delete them; they will be recreated automatically on the first access to the back-end and front-end of our e-commerce. This procedure is also useful when issues arise following updates or module installations. If we do not perform this procedure, calling the URL of our store will result in a 500 error from the server.

Let's regenerate Friendly URL and robots.txt.

We access the Back Office and to finalize our migration, we just need to regenerate the URLs by going to Parameters Store -> General -> SEO & URLs. We also regenerate robots.txt on the same page and then clear the Smarty cache of PS, in Parameters Advanced -> Performance.

Now that our PrestaShop ecommerce is migrated, it is recommended to enable debug in Parameters Advanced -> Performance and perform registration and order tests to ensure everything has gone smoothly. Once the tests are completed, disable debug; your ecommerce is ready to receive the next orders.

Author: Loris Modena

SENIOR DEVELOPER

Per Ind Loris Modena, owner of Arte e Informatica, started working in the IT sector in 1989 as a system administrator responsible for the maintenance and installation of computer systems. He began programming for the web in 1997, focusing on CGI programming in PERL and later transitioning to programming in PHP and JavaScript. During this time, he became familiar with the Open Source world and the management of Linux servers.

Product added to wishlist