Migrate Accounts

Discover accounts on a remote WHM/cPanel server, select what to bring over, and run a background migration job with live progress and controls. Access: root.

What this page does
  • Scan a remote WHM/cPanel host over SSH and list its accounts.
  • Select one or many accounts and choose what to migrate: data (files), mail, MySQL, and DNS-only zones.
  • Optionally assign a package/owner/IP for the new local accounts.
  • Start a background job and monitor live progress per account and per step.
  • Manage jobs: view details, stop, delete, or run a Selective Re-sync of chosen steps.
Prerequisites
  • Remote server is WHM/cPanel with whmapi1, uapi, cpapi2 available.
  • Root SSH access (port default 22). Password is optional; SSH auth must succeed.
  • Local server has at least one package and usable IPs (shared or dedicated).
Scan the remote server
  • Enter Remote Server (IP/host) and SSH Port (default 22). Password is optional.
  • Click Scan Server. The tool connects via SSH and runs whmapi1 listaccts to enumerate accounts.
  • Results populate a table: Domain, Username, IP, Quota Used, Owner with per-row checkboxes and a “Select all”.
Choose migration options
  • After selecting at least one account, the options row appears:
    • Migrate Account Data — rsyncs site files from /home/<user> (excludes system/CP directories).
    • Migrate Account Mail — rsyncs mailbox contents.
    • Migrate Account MySQL — schema + per-table dumps, imported locally.
    • Migrate DNS-only Zones — imports orphan DNS zones not tied to a migrated account.
  • (Optional) Package, Owner, IP — applied to all selected accounts unless overridden during the job logic.
  • Click Start Migration to enqueue a job and start the background worker.
What gets migrated (per account)
  • Account — creates the local system account, applying package, owner, and IP.
  • Domains — subdomains, addon, and parked domains with proper document roots.
  • DNS — zone records converted and written locally; A/SPF may be adapted to the new IP.
  • Email — mailboxes (quota, password), forwarders, and filters.
  • FTP — accounts with home path and quota.
  • MySQL — databases and users with grants; table-by-table import to reduce failure blast radius.
  • Cron — scheduled tasks.
  • SSL — active certs for each domain fetched and assigned locally when available.
Background jobs & progress
  • Each run creates a dedicated migration job tracked in a YAML file, then launches a CLI worker in the background.
  • Open Migration Jobs:
    • View — per-account status and a step list with live messages.
    • Stop — sends a stop signal; in-flight rsync/dumps are terminated.
    • Delete — stops and removes the job file.
    • Selective Re-sync — pick specific steps to rerun for the whole job or a single account.
  • Status codes: 0=Pending, 1=Running, 2=Completed, 3=Error, 4=Stopped.
Steps tracked per account
  • create_account, create_subdomains, create_addons, create_parked, create_dns
  • create_emailaccounts, create_emailforwarders, create_emailfilters, create_ftpaccounts
  • create_databases, create_databaseusers, create_cronjobs, copy_ssl
  • copy_mysql, copy_data, copy_mail, copy_dnsonly (job-level; marked complete on each account for UI consistency)
How the data is copied
  • Files — rsync over SSH; excludes CP/system paths to avoid noise.
  • Mail — rsync of mailbox trees per account.
  • MySQL — creates DB locally, imports schema when empty, then dumps each table remotely and streams into the local MySQL client. Per-table errors are logged; import continues.
  • DNS — parses remote zone files and writes local YAML zones; generates vended zones with defaults and nameservers.
  • SSL — fetches active certs per domain and assigns them to the proper vhosts locally.
Owner, package, IP assignment
  • Owner defaults to root unless overridden. If the remote user is a reseller and limits are detected, the migrated account can be elevated accordingly with caps.
  • Package and IP selections apply to all selected accounts unless the job logic derives a better match.
Selective Re-sync
  • Run only chosen steps (e.g., re-import MySQL, or re-copy mail) for the whole job or a single account.
  • The system resets progress and messages for those steps, then relaunches the worker just for that scope.
Safety & tips
  • Budget a maintenance window for large imports; file and DB copies can be heavy.
  • Open firewall for SSH and ensure remote commands whmapi1/uapi/cpapi2/mysql are usable as root.
  • Re-run selective steps to fix partial failures without restarting a full migration.
  • After completion, rotate sensitive credentials if policy requires (email, FTP, DB users).

Navigation