Moving a database from alternative MySQL (Docker) to the main server
Databases on alternative MySQL servers run in a Docker container. The main server is more stable and faster: if the site does not need a special MySQL version, move the database there.

1. Create a new database on the main server
- "Databases" → "Create a database".
- Database name; the owner is the same user as the site owner.
- "Database server" — MySQL (native), the main one.
- Database username and password. Write them down — you need them for the site config.
- Click "Create".

2. Export the old database dump
- Select the old database → "Dump" → "Export". The browser downloads a
.sqlfile.

phpMyAdmin works too: the database → "Export" → "Quick" → SQL → "Go".
3. Import the dump into the new database
- Select the new database → "Dump" → "Import".
- "Upload type" — "Local computer file". Choose the downloaded file and click "Upload".
- Wait until it finishes. The bigger the file, the longer it takes.



A big dump is faster to load over SSH as root:
mysql -u shop_new -p shop_new < shop_old.sqlThe opposite task — loading a dump into a container database: docker exec -i mysql-8.0 mysql -uroot -p shop_old < shop_old.sql (the container name is in the "Docker" section).
4. Change the connection in the site config
Open the site settings file and enter the new database details. The host is localhost without a port.
| CMS | Where |
|---|---|
| WordPress | wp-config.php: DB_NAME, DB_USER, DB_PASSWORD, DB_HOST |
| OpenCart | config.php and admin/config.php: DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE |
| Joomla | configuration.php: host, user, password, db |
| Laravel | .env: DB_HOST, DB_DATABASE, DB_USERNAME, DB_PASSWORD |
define( 'DB_NAME', 'shop_new' );
define( 'DB_USER', 'shop_new' );
define( 'DB_PASSWORD', 'new database password' );
define( 'DB_HOST', 'localhost' ); // was 127.0.0.1:33105. Check and delete the old database
- Clear the site and browser cache. Go through the site and the admin area.
- No errors — delete the old database. If the alternative server has no more databases, you can delete it too: "Database servers".
A MySQL 8 dump contains the utf8mb4_0900_ai_ci collation. The main server (MariaDB 11) understands it. On old MariaDB versions replace it in the dump file with utf8mb4_unicode_ci.
How to install alternative versions: Database servers.