There are several descriptions online on how to do this but in one occasion, even though I followed the instructions carefully it kept redirecting me to the old domain name. In my particular case the culprit was that the site used file system cache which was active before the move.
The following procedure fixed my problem. The base of the instructions come from the PrestaShop site with my additions below.
- Put the site in Maintenance mode.
- Copy all files from the old site (domain) to the new using for example a FTP program.
- Dump the old site database to a file and import the database on the new server.
- Edit config/settings.inc.php and update the values for _DB_SERVER, _DB_NAME, _DB_USER, _DB_PASSWD and you might need to adjust _PS_DIRECTORY value.
- Using phpMyAdmin, go to the table ps_store_url and update the record regarding domain name and physical uri.
- Using phpMyAdmin, go to the table ps_configuration and find the records for column name with the records for PS_SHOP_DOMAIN, PS_SHOP_DOMAIN_SSL and __PS_BASE_URI__ and update the values corresponding to the new domain name and base uri.
- Using FTP (or other preferred method) clear all content except index.php of the ‘/cache/smarty/compile’ and ‘/cache/smarty/cache’ directories.
- Using FTP (or other preferred method) clear all content of the ‘/cache/cachefs’ directory.
- Log in to the backend and disable Maintenance mode.