# Moving PrestaShop to Another Host: A Step-by-Step Plan

> Moving PrestaShop to another host: exporting the database, transferring files and configuring parameters.php.

PrestaShop stores database connection settings in the `app/config/parameters.php` file and strictly checks the domain match in the `ps_shop_url` table. Forgetting to edit either of these two places is the most common cause of a white screen after moving a store.

## What to check before moving PrestaShop

Before starting, check the PrestaShop version with `php bin/console prestashop:version`, or look at the `app/AppKernel.php` file on older 1.6 installs. Server requirements differ by branch:

| Component | PrestaShop 1.6 | PrestaShop 8 |
| --- | --- | --- |
| PHP | 7.1-7.4 | 8.1-8.3 |
| MySQL | 5.6-5.7 | 8.0 |
| intl extension | required | required |
| Composer | not required | 2.x |

Check the PHP version in advance — PrestaShop 1.6 will not run on PHP 8.3, and PrestaShop 8 requires PHP 8.1 at minimum.

## Moving the store files

Move the `img/p` directory with product images and the `modules` directory with installed paid modules together with the core using rsync:

```
rsync -avz --progress /var/www/prestashop/ user@newserver:/var/www/prestashop/
```

A general overview of rsync, SCP and FTP is in the article [moving site files](https://www.zevshost.net/en/kb/migratsia-failov-rsync-scp/). After copying, check the permissions on the `var/cache` directory — it must be writable by the web server user, otherwise the admin panel returns an access error on first load.

## Exporting and importing the database

Export the database from the "Advanced Parameters → Database → Backup" panel, or from the console:

```
mysqldump -u ps_user -p --single-transaction ps_db > ps_backup.sql
```

On the new server, create a database with the same or a new name and import the dump:

```
mysql -u ps_user -p ps_db < ps_backup.sql
```

The general algorithm for moving MySQL is covered in the article [moving a MySQL database](https://www.zevshost.net/en/kb/perenesti-bazu-dannykh/). Watch the table prefix — `ps_` by default, but older stores may have it changed during installation.

## Configuring parameters.php and the shop\_url table

In `app/config/parameters.php`, update the `database_host`, `database_name`, `database_user` and `database_password` values with the new server's data. Then open the `ps_shop_url` table and check the `domain` and `domain_ssl` fields — if they still point to the old address, the store redirects every request back to the previous host.

```
UPDATE ps_shop_url SET domain = 'newshop.example', domain_ssl = 'newshop.example';
```

After editing, clear the Symfony cache, otherwise PrestaShop keeps using the old compiled settings:

```
rm -rf var/cache/prod/*
rm -rf var/cache/dev/*
```

## Testing the storefront and admin panel

Open the store on the new server by IP, overriding the host in the local `/etc/hosts` file. Test logging into the admin panel at `/admin123` (the admin folder is renamed for security), placing a test order, and loading product images.

Once the test passes, lower the domain's A record TTL to 300 seconds a day before the switch, and after changing DNS check propagation with `dig +short newshop.example` from different servers. A detailed scheme for a switch without downtime is in the article [switching hosting without downtime](https://www.zevshost.net/en/kb/migratsia-dns-bez-prostoya/).

## PrestaShop migration checklist

- The PHP version on the new server matches the PrestaShop version.
- The img and modules directories are moved in full.
- The database dump is imported, the table prefix is checked.
- The parameters.php file and the ps\_shop\_url table are updated.
- The var/cache cache is cleared after editing the configuration.
- Checkout and admin panel login are tested by IP.

Run the final check after the domain switch against the general checklist in the article [post-migration site checklist](https://www.zevshost.net/en/kb/migratsia-proverka-posle/).

---

Source: https://www.zevshost.net/en/kb/migratsia-prestashop/
