Skip to content

How to move a PrestaShop shop to a new host without losing orders

· The AYT team · 6 min read

Woman in sunglasses holding many shopping bags

Moving a PrestaShop shop to a new host comes down to three things: copy all the files, export and import the database, then put the new database details in app/config/parameters.php and empty the cache in var/cache. If the domain stays the same, you change nothing in the database. You test the shop on the new server before changing DNS, and you pause orders on the old one while you copy the data, so no order gets left behind.

Before you start

Write these down so you're not hunting for them mid-move:

  • the PrestaShop version and the PHP version, from Advanced Parameters → Information;
  • the admin folder's name (for example admin123abc);
  • modules whose licence is tied to the domain (some paid modules check it);
  • the shop's cron jobs (sitemap, courier, Cron tasks manager);
  • the mailboxes on the domain and the SMTP settings in Advanced Parameters → E-mail.

The new server has to run a PHP version your PrestaShop version supports. PrestaShop 1.7 isn't officially compatible with PHP 8; see PrestaShop 1.7 and PHP versions and PrestaShop hosting requirements.

Don't cancel the old hosting yet. Keep it running for at least a week after the move.

Step 1: lower the DNS TTL a day before

The TTL says how long networks remember the shop's old address. Lower it to 300 seconds a day ahead, so visitors reach the new server quickly after the switch.

Step 2: pause orders while you copy

Between exporting the database and switching DNS, any order placed on the old server won't reach the new one. For a shop with daily orders, put it in maintenance from Shop Parameters → General → Maintenance, add your own IP to the addresses that can see the shop, and pick a quiet hour at night.

Step 3: copy the files

Copy the whole shop folder, including hidden files (.htaccess). The folders that matter most:

  • img/, with the product photos (usually the largest);
  • modules/ and themes/, with the modules and theme, including your changes;
  • override/, if it exists;
  • app/config/, with parameters.php;
  • download/ and upload/, with virtual product files and what customers uploaded.

You don't need to copy var/cache: it rebuilds itself on the new server.

With SSH, an archive is fastest: tar -czf shop.tar.gz --exclude=var/cache .. Without SSH, download over FTP or create an archive in the old host's file manager.

Step 4: export and import the database

  1. On the old server, export the database from phpMyAdmin (Export → Quick → SQL) or with mysqldump.
  2. On the new server, create a database and a user with rights on it.
  3. Import the export. For large files, a phpMyAdmin import can exceed upload limits; then split the export or ask your host to import it.

Keep the table prefix (usually ps_). If you change it, the configuration has to change too.

Step 5: update parameters.php

On the new server, open app/config/parameters.php (PrestaShop 1.7, 8 and 9) and change only the database details:

'database_host' => 'localhost',
'database_port' => '',
'database_name' => 'new_database_name',
'database_user' => 'new_user',
'database_password' => 'new_password',
'database_prefix' => 'ps_',

Don't touch cookie_key, cookie_iv, new_cookie_key or secret. Sessions, the shop's encrypted data and, on older shops, customer passwords depend on them: if you change them, accounts stop working.

Then empty var/cache/prod and var/cache/dev. PrestaShop rebuilds its cache on the first request. More in clearing the PrestaShop cache.

Step 6: if the domain changes too

With the same domain, skip this step. With a new domain, PrestaShop has to know the new address, or it redirects to the old one. For a single shop (no Multistore):

UPDATE ps_shop_url SET domain = 'new-shop.com', domain_ssl = 'new-shop.com';
UPDATE ps_configuration SET value = 'new-shop.com'
WHERE name IN ('PS_SHOP_DOMAIN', 'PS_SHOP_DOMAIN_SSL');

Clear the cache again. Replace old addresses in descriptions and CMS pages with a search and replace in the database, and add a 301 redirect from the old domain to the new one.

Step 7: test before changing DNS

Add a line to your computer's hosts file with the new server's IP and the shop's domain. Only you will see the shop on the new server.

Check:

  1. the home page, a category, a product (if inner pages return 404, the server lacks the rewrite rules for friendly URLs);
  2. logging in to the back office;
  3. the cart and a test order, with the payment and shipping methods customers use;
  4. order emails going out.

If you see a blank page or a 500 error, turn on debug mode and read the message. The usual causes are wrong details in parameters.php, the PHP version or permissions on var/. For the 500 error, the full guide is PrestaShop error 500.

When everything works, remove the line from hosts.

Step 8: switch DNS and issue the SSL certificate

Point the domain's A record and the www record at the new server. Issue the SSL certificate as soon as the domain points at the new server and check that the shop opens on https://. Take the shop out of maintenance.

After moving the PrestaShop shop

  • Recreate the cron jobs on the new server; token URLs stay the same if the domain and admin folder didn't change. The steps are in PrestaShop cron jobs.
  • Make a real payment for a small amount to check that the payment processor's response reaches the new server.
  • Watch Google Search Console for crawl errors in the first few days.
  • Move the mailboxes before you change the MX records.

Or let us move it

On AYT's paid plans, the move is free for every site included in the plan, PrestaShop shops included (we also move WordPress, Joomla, Drupal and Laravel). We need cPanel, FTP or SSH access to your current host. The move is done within 2 working days, and the shop stays online throughout. After ordering, you open a ticket and we handle the rest.

The moved shop then shows up in the PrestaShop Toolkit: the panel finds it when you open the domain's page or when you click "Scan my folders" in the toolkit's list. On the domain's page, click "Use the PrestaShop nginx profile" so nginx applies the PrestaShop rules. The toolkit works with PrestaShop 8: a PrestaShop 9 shop is listed but not changed from there. What a PrestaShop shop gets on AYT (toolkit, staging, page cache) is under apps.

More articles

All articles