Skip to content

Importing from cPanel ​

This page explains how to move accounts from a cPanel/WHM server to MoorCP: restoring cPanel backup files that are already on a server, migrating in waves straight from the cPanel server, re-sync, tests on the new server, go-live (DNS cutover), and propagation monitoring. It is written for admins.

Open Migration in the Infrastructure group.

What gets imported ​

ComponentResult in MoorCP
AccountLinux user, quotas, and limits from the mapped MoorCP package.
HomeFiles owned by the new account. Symlinks to /home/<old> are remapped, and cPanel PHP handlers in .htaccess are cleaned up. In a wave, home and mail are copied straight from the source with rsync.
DomainsThe main domain, addon domains, and subdomains become websites. Parked domains and ServerAlias entries become aliases. The original PHP version is kept. An addon domain without its own userdata file (the usual cPanel layout) is built from its target subdomain: docroot, PHP version, and the www. alias. If that file is missing too, the addon is skipped with a warning.
DatabasesMariaDB dumps with their users and old password hashes. The prefix is changed if the username changes. PostgreSQL databases too, see PostgreSQL databases.
DNSOld zones are imported. NS and SOA are replaced with the panel's. A records pointing to the old IP are replaced with the new server's IP.
EmailMailboxes with old password hashes, forwarders, catch-all, autoresponders, filters, MX/SPF/DKIM records. Mailboxes stored by cPanel in mdbox format are converted to Maildir, see mdbox mailboxes.
ApplicationsNode.js, Python, and Ruby applications are registered again with the same settings, see Node.js, Python, and Ruby applications.
StatusAn account that is suspended on the source cPanel server is suspended in MoorCP too after a successful import.
OtherSSL certificates, cron, FTP accounts with old hashes, .htpasswd.

Email, database, and FTP passwords keep working without the client resetting them.

A failed component does not fail the whole account. The import report lists errors per stage and the manual steps needed.

An account suspended on the source gets the reason "suspended on the source cPanel server before migration". The import report shows a warning. If the suspend fails, it is listed as a manual step. Unsuspend the account from its page when needed. This applies to waves and to restoring backup files.

What is not imported automatically

Unsupported components are listed in the report, for example pipe filter actions, domain-level email filters, and forwarders that cannot be mapped. Websites whose PHP version is not installed on the target server run on the default version until that version is installed. See PHP versions.

Validation before import ​

Before importing, the panel checks the archive's contents against the target package and server.

CheckWhen exceeded
The archive has a main domainBlocked
Account size (home + databases) against the package disk quotaBlocked when over, warning above 90%
File count against the inode quotaBlocked
Number of databases (MariaDB and PostgreSQL together), mailboxes, and domains against package quotasBlocked
Number of FTP accounts and cron jobs against package quotasWarning, the rest is not imported
PHP version available on the target server and allowed by the packageWarning, the website uses the default version
Capacity rules and maintenance of the target serverBlocked

Blocked accounts get the Blocked status with the reason in the report. Fix the cause, for example by choosing a bigger package, then try again.

PostgreSQL, mdbox mail, and applications ​

These parts of an account need extra handling. They work the same for waves and for restoring backup files.

PostgreSQL databases ​

If the cPanel account uses PostgreSQL, its archive holds the dumps, users, and grants. The import has its own stage for them, Importing PostgreSQL databases, after the MariaDB databases:

  • Databases get the new account's prefix, like MariaDB. Dumps are loaded as the database's owner role, not as a superuser.
  • Users with a SCRAM-SHA-256 hash keep their old password. Users with an MD5 hash get a random password, and the report asks you to set a new one in the panel.
  • GRANT ALL, CREATE, or TEMP on a database becomes full access; CONNECT only becomes read-only access.
  • The cPanel account's own role (without a prefix) is not created. Applications that connected with it must use a prefixed database user.
  • Common extensions such as pgcrypto, uuid-ossp, pg_trgm, hstore, and citext are installed by the dump. Other extensions (for example PostGIS) must be installed first; the report names the missing ones.

The target server must have PostgreSQL set up. If it does not, only this stage fails with a clear message, and the other stages keep going. Set PostgreSQL up on the server with the --pgsql installer option or the API POST /v1/servers/{id}/pgsql/setup (there is no button for it in the GUI; see Setting up PostgreSQL), then import the account again. The setup now also installs the common extensions; servers set up earlier can simply repeat the setup.

PostgreSQL is not re-synced

In a wave, PostgreSQL databases come from the pkgacct snapshot and are not updated by a re-sync. If the data changes before go-live, put the site in maintenance and import the account again.

mdbox mailboxes ​

cPanel can store email in mdbox format, while MoorCP uses Maildir. Without a conversion such mailboxes look empty in webmail even though their quota is used. The import and a re-sync with Email convert them automatically:

  • the mdbox data is copied to Maildir one way, with folders and flags;
  • compressed mdbox from cPanel is read correctly;
  • a Roundcube filter file (.dovecot.sieve) is moved aside during the copy and put back afterwards;
  • the mailbox quota usage is recalculated after the copy.

Running it again does not duplicate messages, and mail that only exists on the new server is kept. If the conversion fails, the mdbox data is put back and the report lists mdbox <address>: .... Every re-sync with Email copies the whole mdbox data from the source again.

Accounts imported before this conversion existed: run Re-sync from cPanel with only Email ticked. On the hosting server, moorcp-agent mail check <address> shows a mailbox's format and content, and moorcp-agent mail convert-mdbox <user> converts an account by hand (see CLI).

Node.js, Python, and Ruby applications ​

The import stage Registering Node.js/Python/Ruby applications creates the account's applications on the target server with the same application root, domain, URL, startup file, version, mode, and environment variables.

SourceWhat is read
cPanel with CloudLinux (Node.js/Python Selector)The Selector settings in the home folder. They are copied with the home, so this also works when restoring a backup file.
cPanel without CloudLinux (Application Manager)The application list, read over SSH. Waves only. The startup file and interpreter are guessed, and the highest installed version on the target is used.

On a CloudLinux target, Node.js and Python apps run through the CloudLinux Selector. On other targets, and for Ruby, they run as MoorCP runtime apps (see Node.js, Python, Ruby). The CloudLinux Passenger block in .htaccess is commented out on a target without CloudLinux, because Apache would answer 500 on it.

  • An application root inside public_html stays there, as on cPanel. The report warns that its files (including .env) can be reached through the website. Move the app out of public_html after go-live if needed.
  • node_modules that point to the CloudLinux nodevenv are kept as they are. Do not run npm install for standalone builds (for example Next.js), because npm removes packages not listed in package.json.
  • Python apps with a requirements.txt get their modules installed.
  • Apps that were stopped on the source are created, then stopped.

The report lists manual steps when the package does not allow the runtime, the runtime version is not installed on the target, or node_modules is missing. moorcp-agent app check <user> on the hosting server checks an app's unit, startup file, node_modules, and HTTP answer (see CLI).

Restoring cPanel backups from files on the server ​

Use this when the cPanel backup files are already on a MoorCP server, for example backups a client sent you or a cPanel server that no longer exists. No connection to the cPanel server is needed.

Recognized files:

File nameMade byType in the GUI
cpmove-<user>.tar.gz (or .tar)pkgacct, WHM Transfer Toolcpmove
backup-<date>_<user>.tar.gzcPanel full backup (Backup or Backup Wizard)Full backup

Incremental backups (a folder instead of a tar file) are not supported yet.

1. Put the files on the server ​

Copy the backups to the server as root, into /root, /home, or /var/lib/moorcp/import, for example:

bash
scp backup-*.tar.gz root@srv1.example.com:/root/

The panel looks in those folders and up to two folder levels below them. Only regular files owned by root are listed. Hidden folders, account home folders, symlinks, and /tmp are skipped, so a client cannot slip in an archive through their own home.

2. Choose and restore ​

  1. Open Migration, then click Restore cPanel backup.
  2. Choose the Server where the files are stored. The accounts are created on that server.
  3. Tick one or more files in the list (File, cPanel user, Type, Size, Modified). Use Search to filter, or Scan again after copying new files. Click Next.
  4. Fill in the Billing client ID (used for every restored account), and per backup the New username (taken from the file name by default; 3–16 lowercase letters or digits, starting with a letter) and the MoorCP package.
  5. Read Check before restoring, tick the confirmation, then click Restore N accounts.

The archive is not read in these steps, so very large backups can be queued right away. Each account is restored by its own migration.cpanel_import job. Several jobs run at the same time per server, as set in Parallel migration. The result list has an Open job link per account, where you follow the progress and read the import report. Domains, databases, mailboxes, and the cPanel plan are read during the restore and listed in the report. The backup files are not changed or deleted.

How the job reads the archive ​

A .tar.gz archive can only be read from start to end, so the job reads it once: home files, database dumps, and settings are unpacked into a temporary folder under /home, then the home is moved into the new account and the databases are imported. The temporary folder is removed when the job ends, whether it succeeded or failed.

  • /home needs at least as much free space as the archive size. This is checked before reading.
  • A restore fails right away when the new username already exists. Choose another username and try again.
  • The job page shows how much of the archive has been read, the speed, and the time left.

With the CLI ​

moorctl uses the same API (MOORCTL_URL, MOORCTL_API_KEY):

bash
moorctl migrate cpanel --server SERVER_ID --archive /root/cpmove-jane.tar.gz --package PACKAGE_ID --client CLIENT_ID --wait

Extra options: --username for a new username, --domain for a different main domain, --skip dns,mail to skip components, and --no-replace-ip to keep old A records unchanged. --wait waits up to 24 hours for the job and then prints the report. Read the report again later with:

bash
moorctl migrate report JOB_ID

With the CLI, the archive can also be in /tmp. moorctl migrate inspect still shows the contents of a small archive without importing it (limited to 10 minutes).

Migrating in waves from a cPanel server ​

To move many accounts, register the cPanel server as a source, then create a wave. The panel runs pkgacct on the source over SSH, downloads the archive to the target server, validates it, and imports it.

1. Add a cPanel source ​

  1. Click New source.

  2. Fill in:

    FieldNotes
    NameSource name, for example old-cpanel-1.
    HostHostname or IP of the cPanel server.
    SSH portDefault 22.
    SSH userroot. pkgacct needs root.
    SSH private keyA private key accepted by the cPanel server. Stored encrypted and never shown again.
    Default packageMoorCP package for cPanel plans that are not mapped.
    Package mappingcpanel_plan=package_id, separated by commas. Used by every wave from this source. Choices saved from the wave form are added here too.
    Home root (optional)Leave empty to read the home location from the source. Fill it only to force a location.
  3. Click Save.

Root SSH access

The source's SSH key gives root access to the cPanel server. Use a key dedicated to the migration and remove it from the cPanel server once the migration is done.

The target server connects to the source, so allow the target server's IP in the cPanel server's firewall for the SSH port.

2. Create a wave ​

  1. Click New migration.
  2. Choose the Source cPanel server.
  3. Choose the Target server. The account list is read from WHM (whmapi1 listaccts) after the target server is chosen. If WHM refuses the request (for example on a cPanel server whose license has expired), the list is read from /var/cpanel/users over the same SSH connection. Accounts suspended on cPanel are marked Suspended.
  4. Fill Wave name and Billing client ID. The client ID is used for all accounts in this wave.
  5. Tick the cPanel accounts to move.
  6. Under Package per cPanel plan, check the MoorCP package chosen for each cPanel plan of the ticked accounts. Each plan is matched by the source's package mapping, then by a MoorCP package with the same name (the WHM reseller prefix such as owner_ is ignored), then by the source's default package. Change any of them here. A plan without a package must be filled in before you can continue.
  7. Tick Remember these choices in the source's plan mapping to reuse them in later waves.
  8. Click Create wave (N accounts).

Wave size

Start with a small wave of a few simple accounts. Once the flow runs smoothly, create bigger waves.

3. Run the import ​

  1. Open the wave from the Migration waves table and click View.
  2. Click Run import.
  3. Optionally tick Go live automatically after a successful transfer (switch DNS), see Automatic go-live. Click Run import in the dialog.

Each account goes through these stages:

  1. Packaging the account on cPanel: pkgacct on the source, without the home folder (metadata, DNS, SSL, and database dumps), then the archive is copied to the target server.
  2. Checking package limits (see Validation before import).
  3. Creating the account, then Copying home and mail: home and mail are copied straight from the source with rsync over SSH, without an intermediate archive. An interrupted copy resumes, and a re-sync later only copies changes.
  4. Creating websites, Importing databases, Importing PostgreSQL databases, Importing DNS zones, Creating email accounts, Registering Node.js/Python/Ruby applications, and Installing SSL certificates.
  5. Applying websites (one web server reload): the account's websites and certificates are applied in one batch, so the web server reloads once per account instead of once per website or certificate.
  6. Restoring cron jobs and Restoring FTP accounts.

Finished accounts get the Completed status.

Progress is shown live (refreshed every 2 seconds) in the wave's account table, the account's details, and the job page: the stage, percentage, bytes copied, speed, and time left.

Malware scanning during import

While the home is being filled, realtime malware scanning of that account is paused and scheduled scans skip it, so the import is not slowed down by scanning every file. One full scan of the account is queued once the import is done.

Sites can already be tested through the hosts file before DNS changes.

Parallel migration ​

Migration jobs (import, re-sync, and go-live) run in their own worker lane, several accounts at the same time per target server. Other panel jobs such as SSL, websites, suspends, and backups never wait behind a migration.

To change the number, click Settings on the Migration page (admins only) and set Accounts migrated at the same time (per destination server), from 1 to 8 (default 3). A new value takes effect within about 15 seconds. A higher number finishes a wave sooner, but puts more load on the source cPanel server (pkgacct, rsync) and on the target server.

Failed or blocked accounts appear in the Needs attention card. Open the account to see the error and its report. Once the cause is fixed, click Retry failed. The import is repeated for waiting, failed, and blocked accounts. Other accounts keep going.

Automatic go-live ​

With Go live automatically after a successful transfer (switch DNS), each account that imports successfully is queued for go-live right away. Go-live still re-syncs first (changes made during the import are copied) and tests the account on the new server. An account whose tests fail stops and waits in Needs attention. A separate Re-sync all from cPanel step is not needed in this mode.

Two more options apply to the automatic go-live: Suspend the account on the source and Don't change the source zone (see Going live). The choice is saved with the wave. With the CLI: moorctl migrate wave-start WAVE_ID --auto-cutover --suspend-source.

Going live (cutover) ​

After the initial import, the account on the source still serves visitors. Going live (cutover) moves DNS to the MoorCP server, like finishing a cPanel transfer. The GUI uses cPanel-familiar names for each step; the API, the CLI, and the status names still use the old terms (final sync, checks, cutover). Recommended schedule:

StepWhenButtonWhat happens
Initial importD-7Run importFull import. Sites can be tested.
1. Lower TTLD-31. Lower DNS TTLA/AAAA records in the source cPanel zone that point to the old IP get a TTL of 300 seconds.
2. Re-sync (final sync)D-1 and right before go-live2. Re-sync from cPanelCopies the chosen parts again: files and mail changed since the import, and fresh database dumps. Does not touch DNS. Can be repeated.
3. TestsBefore go-live3. Test on the new serverHTTP for each domain, TLS, databases, and mailboxes.
4. Go-liveAt go-live time4. Go live (switch DNS)Re-sync, tests, then DNS is pointed to the new server.
5. Check propagationD+0 to D+75. Check DNS propagationPublic resolver answers are compared with the new IP.
Mail deltaD+1, optional2. Re-sync from cPanel with only Email and no deletionMail still arriving at the source during propagation is copied without deleting mail on the target.

Per-account buttons are under Steps to move this account in the wave account's details (Details). For all accounts at once, use Re-sync all from cPanel and Go live all in the wave's details. One job is created per account, and the jobs run in parallel as set in Parallel migration.

Re-sync from cPanel (final sync) ​

Choose the parts to copy again under Re-sync from cPanel: parts to copy again (per account) or in the Re-sync all from cPanel dialog:

OptionWhat is copied
Files (home directory)The home folder, with the new account as owner. cPanel-specific folders (.cpanel, cpbackup, access-logs, etc, and others) are skipped.
EmailThe content of every mailbox (~/mail), with mdbox converted to Maildir. Mailboxes created on the new server are never deleted.
DatabasesMariaDB databases are replaced entirely from a fresh dump. User grants are kept.
Delete files that no longer exist on the sourceRemoves files on the target that were deleted on the source.

Pick at least one part. Use a single part to migrate just that part again, for example Email only when mailboxes came over empty, without touching the website files and databases. For an account that is already live, the default is Email without deletion, and the panel warns when you tick Databases or deletion. If mail already arrives on the new server, turn deletion off so new messages there are kept.

With the CLI: moorctl migrate sync WAVE_ID jane --scope mail --no-delete.

Databases are replaced entirely

A re-sync with Databases replaces the target database with the source's content. Changes made directly in the target database are lost. Do not let the client start working on the new server before go-live. PostgreSQL databases are not re-synced (see PostgreSQL databases).

Tests on the new server ​

3. Test on the new server tests the website, SSL, databases, and email login. The results appear in Tests on the new server. Each test's result is Passed, Warning, or Failed.

The SSL test is only a warning. Let's Encrypt certificates for migrated domains can only be issued once DNS points to the new server.

Going live ​

  1. Click 4. Go live (switch DNS) on the account, or Go live all on the wave.

  2. Choose the options (per account):

    OptionPurpose
    Go-live: suspend the account on cPanelThe cPanel account is suspended after go-live.
    Go-live: don't change the DNS zone on cPanelThe DNS zone on the source cPanel is not changed.
    Go-live: continue even if tests failedGoes live even when tests fail.
  3. Confirm.

Go-live runs a re-sync and the tests. If tests fail, it stops unless forced. If they pass, A/AAAA records in the panel's DNS and in the source cPanel zone are pointed to the target server's IP. The account's status becomes Cut over, and the wave summary counts it as live.

Go-live is refused when the target server has no primary IP or the account has not been imported. A running go-live job cannot be stopped from Jobs, because its rollback runs in the same job; a queued one can still be cancelled.

Nameservers

If the domain still uses the cPanel nameservers at the registrar, the zone change on the source cPanel is what counts. The zone in the panel's DNS has been correct since the import and takes over as soon as the client moves the nameservers to the panel.

cPanel DNSOnly nameservers ​

If client domains use cPanel DNSOnly nameservers, and that DNSOnly is registered as a replica in Domains & DNS › Nameserver nodes, clients do not need to change nameservers. The panel holds the imported zones back from that replica until go-live:

  • The initial import creates the account's zones in MoorCP already pointing to the new server. While a zone is held, MoorCP does not create, change, or delete it on DNSOnly. DNSOnly keeps serving the version from the source cPanel server, including the lowered TTL.
  • MoorCP's PowerDNS nodes still receive the zone as usual.
  • Cutover releases the hold. After the A records in the source zone are pointed, cutover immediately copies the MoorCP zone to every DNSOnly, replacing the version from the cPanel server. The result is recorded in the account's cutover report. If the copy fails, the periodic DNS sync retries it.

The cPanel DNSOnly replicas card shows N migrated zone(s) held until cutover, with their accounts.

If an account's migration is abandoned, release its hold manually:

  1. In the list of held zones, click Release on the zone's row.
  2. Click Release and copy.

The MoorCP zone is copied to DNSOnly right away, so the domain points to the MoorCP server immediately. Only admins can release a hold, and the action is recorded in the audit log (dns.replica.release).

After cutover

The source cPanel server still holds the zone in its DNS cluster:

  • Remove the account on cPanel with the option to keep its DNS zone. Without it, cPanel deletes the zone from DNSOnly, and the domain does not answer until MoorCP's sync recreates it (at most 10 minutes by default). The Run reconciliation button on the DNS zones page restores it right away.
  • Do not run Synchronize DNS Records in WHM on the source server for domains that were moved. Its old version overwrites the MoorCP zone until the next sync round.
  • Once all accounts on a cPanel server have moved, remove that server from its DNS cluster.

Forcing go-live

Go-live: continue even if tests failed can leave the client's website or email down after DNS moves. Use it only after you have checked the cause of the failed tests yourself.

Monitoring propagation ​

5. Check DNS propagation shows the DNS propagation table: each public resolver, the Expected IP, and the Answer. The result is All match or Not everywhere yet.

Monitor for 3 to 7 days. Once every resolver matches:

  1. Run a mail delta re-sync (Email only, no deletion) if email is still arriving at the source.
  2. Reissue the websites' SSL.
  3. Remove the migration SSH key from the cPanel server.

Reports and history ​

  • The wave's details show a summary (running, queued, completed, live, failed, skipped), the account table with each step's status (Import, Re-sync, Test, Go live), and the Activity timeline.
  • The account's details show the Full report: archive summary, validation results, import per stage, TTL, sync, checks, cutover, and propagation.
  • All actions are recorded in the audit log with the staff actor.
  • moorctl migrate wave-report WAVE_ID prints a wave summary from the command line: status, import time, and problem stages per account. Add a cPanel username for one account's details: every import stage with status, counts, duration, messages, per-item errors, manual steps, warnings, and the last re-sync, tests, and go-live. --json prints JSON. See CLI.

Deleting a cPanel source also deletes its waves. Accounts that were already imported remain.

Migrating with the CLI ​

Every step can be run with moorctl migrate, for example in scripts. The CLI keeps the old names (sync for re-sync, cutover for go-live):

bash
moorctl migrate wave-start WAVE_ID --wait
bash
moorctl migrate wave-start WAVE_ID --auto-cutover --suspend-source
bash
moorctl migrate sync WAVE_ID jane --scope mail --no-delete --wait
bash
moorctl migrate cutover WAVE_ID jane --suspend-source --wait
bash
moorctl migrate wave-report WAVE_ID jane
bash
moorctl migrate propagation WAVE_ID jane

The full command list is in CLI.

See also ​

MoorCP Shared, a shared hosting panel for server fleets.