berth

Migration

Importing backup files

Turn a Plesk backup, a cPanel cpmove file or a DirectAdmin user backup into subscriptions, in batches if needed, move a subscription between Berth servers with an encrypted transfer file, or fetch a single site over FTP or SFTP.

Updated 6 min readimport · plesk backup · cpmove · directadmin · transfer · restoreView as Markdown

On this page
  1. The import page
  2. Plesk backups
  3. cPanel and DirectAdmin account backups
  4. Moving a subscription between Berth servers
  5. A single website over FTP or SFTP
  6. Related

Not every move starts from a live server you can connect to. Sometimes you have a backup file from a previous host, a customer who brings their own cpmove archive, or a single subscription to move between two Berth servers. Berth reads these files and builds complete subscriptions from them, with mailboxes, databases, certificates and passwords where the file allows it.

For whole servers that are still running, the migration console is usually the better route: it syncs repeatedly and switches over without customers noticing. See Moving to Berth for the comparison.

The import page

All file imports start on one page: Admin → Migration → Import, titled Import a backup or transfer file.

  1. Upload the file with Upload backup, or for a Berth transfer file, upload it or let Berth fetch it.
  2. Berth checks the file first and shows what is in it: per subscription what comes along, what does not and why, conflicts with what already exists here, and under which customer and reseller it will land. Nothing is created yet. Check only keeps it at that.
  3. Adjust the target if needed: the package (by default the package with the source's name if it exists, otherwise basis), the customer, and whether the subscription goes under an existing customer.
  4. Choose Import, per subscription for Plesk.

Uploads are removed automatically after a day. If an account had a password that could not be carried over, the result shows a new one once (New passwords — copy them now): pass it on to the customer or set another.

Resellers come along: a customer who belonged to a reseller on the old server lands under the same reseller here, which is created if needed (without limits; set them afterwards under resellers).

Imports need a valid licence or the trial period; see Licence and trial.

Plesk backups

Use the backup that Plesk's Backup Manager lets you download: a .tar file, also compressed, of one subscription, a customer or the whole server.

Plesk stores some passwords encrypted with the server's own secret_key. To carry those over, give the import that key under Plesk: take passwords along, as a hex string; the page shows the command that prints it on the old Plesk server. Without the key, the affected accounts get a new password that is shown once.

berth import --file plesk-backup.tar --dry-run
berth import --file plesk-backup.tar --subscription example.nl \
  --secret-key-file /root/secret_key --plan basis

--subscription takes the system user or the main domain. Among other things, these come along: domains with aliases, PHP settings, certificates, mailboxes with their mail, forwards and autoresponders, DKIM keys, databases with their users, FTP accounts, protected folders and cron jobs. Cron jobs arrive switched off, so nothing runs before you have checked the paths.

Treat the secret_key as a secret and remove the file from the new server once the import is done.

cPanel and DirectAdmin account backups

An account backup becomes one subscription in a single step:

  • cPanel: cpmove-<user>.tar.gz, as made by pkgacct or the Backup Wizard;
  • DirectAdmin: user.<reseller>.<user>.tar.gz, also as .tar.zst.

Upload it on the import page, review the check and conflicts, and confirm.

berth import --file cpmove-acme.tar.gz --dry-run
berth import --file cpmove-acme.tar.gz --plan basis --customer acme
berth import --file user.reseller1.acme.tar.zst --into-existing --customer acme

What comes along: the customer, the main domain with parked domains as aliases, addon domains and subdomains, the files, mailboxes with their password and mail (Maildir, with UIDs, so mail clients do not download everything again), mail aliases and forwards, MySQL databases with their users and passwords, FTP accounts, valid certificates, DKIM keys, and cron jobs (switched off, because their paths point to the old home directory). Mail folder names that cPanel and DirectAdmin store in modified UTF-7 are converted to UTF-8, the way Dovecot on Berth stores them.

What does not come along, with a notice in the check: PostgreSQL databases, forwards to a program, mailboxes with a password hash Berth does not recognise, and for DirectAdmin the SFTP password.

Many files at once

Put all cPanel and DirectAdmin backups in one directory and import them in one run. An error skips only that one backup; the rest continue.

berth import --dir /root/backups --dry-run
berth import --dir /root/backups --plan basis

Moving a subscription between Berth servers

Between two Berth servers, a subscription moves as one encrypted transfer file: files, databases, mail, logins with their password hash and second factor, DKIM keys, certificates, mail aliases, cron jobs and domain settings. The file is encrypted with a passphrase of at least 12 characters.

  1. On the old server: the customer's page → Move to another Berth server. Choose a passphrase and click Create export file.
  2. On the new server: Admin → Migration → Import. Upload the file with the same passphrase, or choose Let it fetch: give the old server's address and an API key of an administrator there. Berth then asks the old server to create the file, fetches it and imports it in the background. The API key stays in memory only.

On the old server:

berth transfer export --sysuser acme --out acme.berth --passphrase-file /root/passphrase

On the new server, import the file, or fetch it directly:

berth transfer import --file acme.berth --passphrase-file /root/passphrase --dry-run
berth transfer import --file acme.berth --passphrase-file /root/passphrase
berth transfer pull --from https://old.example.nl --token-file /root/api-token \
  --sysuser acme --passphrase-file /root/passphrase

--dry-run reports conflicts without changing anything. The subscription keeps its uid, or gets a free one if that uid is taken. --customer and --into-existing place it under another or an existing customer; --ca-cert trusts an old server without a public certificate.

Containers with their own image. An image from a registry is pulled again by the new server. An image the customer uploaded themselves exists only on the old server and comes along only if you choose so: the customer's page shows Take own images with their number and size, or use --images on export or pull (berth transfer images --sysuser acme shows the same). This needs temporary disk space on the old server and makes the file larger; Berth stops beforehand if it does not fit. Without it, the import skips containers with such an image and tells you so.

For moving every subscription of a Berth server at once, use the migration console with Berth as the source.

A single website over FTP or SFTP

For one website at a host without a panel, or where all you have is FTP access, use Import on the domain's page. Berth fetches:

  • the files over SFTP, FTPS or plain FTP, from a folder you choose (for example public_html), into the document root or a subfolder here;
  • the database straight from the old database server into an existing database of the subscription, if that server accepts connections from outside. If it does not, export it there and import the dump under Databases instead.

For WordPress, Berth then adjusts wp-config.php for the database here and, if you want, replaces the old address with the new one (--replace-url takes the old address). Files with the same name are overwritten. Passwords are only kept for the duration of the import.

berth domain import start --domain acme.nl \
  --protocol sftp --host old-host.example.com --user acme --password-file /root/ftp-pw \
  --remote-path public_html \
  --db-host db.old-host.example.com --db-user acme --db-name acme_wp \
  --db-password-file /root/db-pw --target-db acme_wp \
  --replace-url https://acme.old-host.example.com
berth domain import list --domain acme.nl

The import runs in the background; its log shows what happened. Check the site, then change the DNS.