Migrate Prestashop to another server

Move PrestaShop to new server or domainIf you need to migrate a PrestaShop website from a local to a remote installation or just change the domain name, you need to follow these steps:

0. For security reasons, make a backup of all files and database

1. Upload all files to new hosting via FTP

2. Import the database using the phpMyAdmin utility or through terminal

3. On database we need to open  ps_configuration table and edit the following lines: PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL and we replace the current domain www.olddomain.com, with the new one www.newdomain.com

4. Update ps_shop_url to match the new path and domain
[cc lang=”sql”]UPDATE `ps_shop_url` SET `domain` = “www.newdomain.com”, `domain_ssl` = “www.newdomain.com”, `physical_uri` = “/”;[/cc]
If your PrestaShop is under a subdirectory of the main website you have to set physical_uri to “/shop/” or similar.

5. For last we have to edit the settings.inc.php file inside the config folder and change the values for database name  _DB_NAME_, user _DB_USER_ and password: _DB_PASSWD_

6. Copy across your COOKIE hashes as well: _COOKIE_KEY__COOKIE_IV_, _RIJNDAEL_KEY_, _RIJNDAEL_IV_  otherwise the user won’t be able to login including the admin user of PrestaShop

In settings.inc.php you have the following fields:
[cc lang=”php”]
define(‘_COOKIE_KEY_’, ‘wjawOHv6ZUKlo0Ewy8Qr3sjYYBAdgcfekAbU3bgAcJgHz3mETtyggtjo’);
define(‘_COOKIE_IV_’, ‘a2LWT1T4’);
define(‘_RIJNDAEL_KEY_’, ‘Le4Lkak7GbkTxeK5HLzchFIHx9xQQQ3WF’);
define(‘_RIJNDAEL_IV_’, ‘1p+Cc0gcZOKtKR9ozrBRyg==’);
Make sure that all these fields have been copied across to the new installation and the values are exactly the same. The main reason is that COOKIES and PASSWORDS get encoded with those values and if they don’t match the user won’t be able to login.

That’s it, you only need to check  .htaccess file permissions (777) and all should work correctly!


Just a guy with strong interest in PHP and Web technologies

Tagged with: , ,
3 comments on “Migrate Prestashop to another server
  1. frodito says:

    I understand everything except for #6… how I do the cookie thing??


    • SANDO says:

      @frodito I’ve updated the post, but briefly, make sure that the content under root/config/settings.inc.php match on both installations

  2. best advice about generating leads says:

    Have anything else a bit more distinct? 🙂 Such as, ratings
    or even stories about domain. How can I subscribe to the articles you write?

Leave a Reply to SANDO Cancel reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.