Change or Move PrestaShop Site Domain Name

Warning

This entry was written more than 1 year ago. Please read the article keeping in mind its age.

How I moved a PrestaShop site to another domain name

Recently I moved a Prestashop site from a staging server to the production server, which also means changing the domain name from eg: staging.example.com to www.example.com.

The PrestaShop site was ready for production so I really didn't want to install everything from scratch and I believed that just copying the php files and keeping the same the MySql DB was enough. Well, I was wrong!!!

Every time I was pointing my browser to www.example.com a redirection was giving me staging.example.com. Again... I had to investigate and solve !

I checked DNS records, they were fine and the Apache configuration wasn't redirecting anywhere. I was pretty sure about that but I had a look just in case.

So the problem had to be inside the PrestaShop directory... first one that I could blame was the .htaccess file, but after a quick look there was no sign of redirection.

Then I run a grep command to check php source files and I visually inspected the configuration ones. Again no joy, I couldn't find anything that was pointing me staging.example.com.

My last option was to look inside the MySQL DB and its 164 tables using phpMyAdmin. I was lucky I started with the obvious one... ps_configuration and BANG !!!

There it was ``staging.example.com``, stored inside the MySQL Database.

Long story short...
If you DO NOT CHANGE the domain name stored in your MySQL database, when you access to your new domain it will always be redirect to old domain website.

What to do to move a PrestaShop site

  1. Backup you MySQL DB... you never know.
  2. Use phpMyAdmin or any other MySQL client that you like
  3. Connect to the DB an look for ps_configuration table
  4. Find the following records:
    • PS_SHOP_DOMAIN
    • PS_SHOP_DOMAIN_SSL
  5. Edit those record, eg change staging.example.com domain name to www.example.com
  6. Copy your php files from the staging server to the new server
  7. Clean your browser cache if you still seeing the old website.

Update 20/07/2015

I just received an email from R. which says that in the new versions of PrestaShop you have also to change row in table pres_shop_url.

Danilo