How to change domain name for Prestashop 1.7 directly in Database via PHPMyAdmin

How to change domain name for Prestashop 1.7 directly in Database via PHPMyAdmin

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:

ps-shop-url
ps-shop-url

Edit and change the value for both domain and domain_ssl values.

domain and domain_ssl values
domain and domain_ssl values

Step 2. Change table “ps_configuration” – value of both PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL

ps_configuration
ps_configuration

Same as in step 1, edit both PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL values to reflect new domain name:

PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL
PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL

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

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.