While migrating Prestashop 1.7 to another hosting or domain name, it’s necessary to change the domain name directly in the database using PHPMyAdmin and rewrite the .htaccess file afterward.
There are 4 values that need to be edited inside the database, for Prestashop v 1.7 to work under a new domain:
Step 1. Change table “ps_shop_url” – both domain and domain_ssl values:
Edit and change the value for both domain and domain_ssl values.
Step 2. Change table “ps_configuration” – value of both PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL
Same as in step 1, edit both PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL values to reflect new domain name:
Here is also a useful SQL snippet that will update site URL in the database to “example.com”
UPDATE `ps_configuration` SET `value` = 'example.com' WHERE `ps_configuration`.`id_configuration` = 229; UPDATE `ps_configuration` SET `value` = 'example.com' WHERE `ps_configuration`.`id_configuration` = 230; UPDATE `kh_shop_url` SET `domain` = 'example.com', `domain_ssl` = 'example.com' WHERE `kh_shop_url`.`id_shop_url` = 1;
*replace example.com with your new domain name.
After editing and saving these values, the website should no longer redirect to the old domain name, but there is one more thing to do in order to fully complete the migration process of Prestashop 1.7 to another domain name.
Step 3. Rewrite the .htaccess file