//Servers

Seamless cPanel to CloudPanel Migration for 50+ Accounts

Migrate 50+ cPanel accounts to CloudPanel on Ubuntu 22.04. Step-by-step guide for exporting, importing, and minimizing downtime.

6 min read
Seamless cPanel to CloudPanel Migration for 50+ Accounts

Moving many cPanel accounts to CloudPanel can seem overwhelming, especially when dozens of sites must stay online during the transition. This guide outlines a repeatable, low‑risk process for migrating 50 + cPanel accounts to CloudPanel on a single VPS running Ubuntu 22.04. By dividing the work into preparation, export, CloudPanel installation, import, and post‑migration checks, you can finish the move with minimal downtime and clear rollback options.

1. Prepare the source and destination servers

Before touching live data, verify that both the cPanel server and the new CloudPanel VPS are ready.

1.1. Verify system resources

  • CPU: ≥ 4 cores
  • RAM: ≥ 8 GB (more for high‑traffic sites)
  • Disk: at least twice the current cPanel usage to hold backups and temporary files

1.2. Update packages

Run the following on both servers to keep the OS current.

# Ubuntu 22.04 (both source and destination)
sudo apt update && sudo apt upgrade -y

1.3. Secure SSH access

Create an SSH key pair on the CloudPanel VPS and copy the public key to the cPanel server. This enables password‑less, encrypted file transfers.

# On CloudPanel VPS
ssh-keygen -t ed25519 -C "cloudpanel-migration"   # accept defaults
ssh-copy-id root@cpanel-source.example.com

1.4. Create a dedicated migration user

On the cPanel server, add a low‑privilege user that can read account data but cannot modify system files. This reduces risk if something goes wrong.

# On cPanel server
adduser --disabled-password --gecos "" migrate
usermod -aG www-data migrate

2. Export cPanel accounts

cPanel’s scripts/pkgacct utility packages each account into a tarball containing home directories, databases, and configuration files.

2.1. List all accounts

# On cPanel server
awk -F: '{print $1}' /etc/passwd | grep -E '^[a-z0-9._-]+$' > /root/cpanel_accounts.txt

2.2. Batch‑package accounts

Run the packaging script in a loop, storing the tarballs in /home/migrate/packages and compressing them to save bandwidth.

# Create destination directory
mkdir -p /home/migrate/packages

# Loop through accounts
while read acct; do
    echo "Packaging $acct..."
    /scripts/pkgacct $acct --output=/home/migrate/packages/${acct}.tar.gz
done < /root/cpanel_accounts.txt

2.3. Export databases (optional)

cPanel packages already contain MySQL dumps, but creating a separate backup can speed up restores.

# Export all MySQL databases to a single file
mysqldump --all-databases --single-transaction --quick --lock-tables=false > /home/migrate/all-databases.sql
gzip /home/migrate/all-databases.sql

2.4. Transfer packages to the CloudPanel VPS

Use rsync over SSH to move the tarballs. The --progress flag shows transfer status.

# From CloudPanel VPS
rsync -avz --progress migrate@cpanel-source.example.com:/home/migrate/packages/ /var/tmp/cpanel-packages/

3. Install and configure CloudPanel

CloudPanel runs on Ubuntu 22.04. Follow the official installer, then adjust the configuration to match your hosting needs.

3.1. Install prerequisites

# CloudPanel VPS (Ubuntu 22.04)
sudo apt install -y curl gnupg2 ca-certificates lsb-release apt-transport-https

3.2. Add the CloudPanel repository and install

curl -sSL https://repo.cloudpanel.io/installer.sh | sudo bash
sudo apt install -y cloudpanel

3.3. Open required ports

CloudPanel uses ports 80, 443, 8443 (admin UI) and optionally 3306 for MySQL. Adjust the firewall accordingly.

# Using ufw
sudo ufw allow 80,443,8443/tcp
sudo ufw allow 3306/tcp   # optional, only if remote DB access is needed
sudo ufw reload

3.4. Choose a web‑server stack

From the CloudPanel web UI, select “Nginx + PHP‑FPM (recommended)” for most PHP sites.

# In the CloudPanel UI (https://your‑vps‑ip:8443)
# → Settings → Server Stack → Select “Nginx + PHP‑FPM (recommended)”

4. Import cPanel accounts into CloudPanel

CloudPanel does not provide a one‑click cPanel import, but you can recreate each account manually using the packaged data.

4.1. Create corresponding users

For each tarball, extract the username and add a CloudPanel user with the same name.

# Loop on CloudPanel VPS
cd /var/tmp/cpanel-packages
for pkg in *.tar.gz; do
    uname=$(basename "$pkg" .tar.gz)
    echo "Creating CloudPanel user $uname"
    sudo cloudpanel user:create "$uname" --email "$uname@example.com"
done

4.2. Restore home directories

Extract the public_html folder and other content into the new user’s home directory.

# Example for a single account
tar -xzf /var/tmp/cpanel-packages/exampleuser.tar.gz -C /home/exampleuser --strip-components=2 home/exampleuser/public_html
chown -R exampleuser:exampleuser /home/exampleuser
chmod -R 755 /home/exampleuser

4.3. Import databases

Each cPanel package contains a sql folder with individual database dumps. Import them into CloudPanel’s MySQL instance.

# Loop through all SQL files for a user
for sqlfile in /home/exampleuser/sql/*.sql; do
    dbname=$(basename "$sqlfile" .sql)
    # Create database and owner in CloudPanel
    sudo cloudpanel db:create "$dbname" --owner exampleuser
    # Import data
    mysql -u root -p"$MYSQL_ROOT_PASSWORD" "$dbname" < "$sqlfile"
done

4.4. Recreate DNS records

If DNS is managed on the cPanel server, export the zone files and import them into CloudPanel’s DNS module.

# On cPanel server (export)
for domain in $(ls /var/named/); do
    cp "/var/named/$domain" "/home/migrate/dns/$domain"
done

# Transfer
rsync -avz migrate@cpanel-source.example.com:/home/migrate/dns/ /var/tmp/dns/

# On CloudPanel VPS (import via UI or CLI)
for zone in /var/tmp/dns/*.db; do
    zonename=$(basename "$zone" .db)
    sudo cloudpanel dns:import "$zonename" "$zone"
done

5. Validate and switch traffic

After the data is in place, perform thorough checks before pointing live traffic to the new server.

5.1. Functional testing

  • Access each site via a temporary host entry (e.g., 127.0.0.1 example.com) to verify pages load.
  • Run curl -I https://example.com and confirm a 200 OK response.
  • Check database‑driven functionality such as logins, forms, and CMS admin panels.

5.2. Performance baseline

Use ab or wrk to record response times for a few representative pages. Compare with previous cPanel metrics to ensure the new stack meets expectations.

5.3. Update DNS

When you’re satisfied, change the authoritative DNS records (or your Cloudflare/Route 53 settings) to point to the CloudPanel VPS IP. Reduce TTLs a day before the switch to minimise propagation delays.

5.4. Keep the old server running briefly

Maintain the cPanel server for 24‑48 hours as a safety net. Monitor logs on both sides; once you’re confident there are no missing files or broken links, decommission the old VPS.

6. Post‑migration cleanup and automation

6.1. Remove temporary files

# On CloudPanel VPS
rm -rf /var/tmp/cpanel-packages /var/tmp/dns

6.2. Automate backups

Configure CloudPanel’s built‑in backup scheduler to create daily snapshots of user data and databases. Store backups on a separate storage bucket (e.g., AWS S3 or a local NAS).

6.3. Document custom configurations

Record any manual tweaks made during migration—custom Nginx rewrites, PHP extensions, cron jobs—in a shared wiki or version‑controlled repository.

Conclusion

Migrating 50 + cPanel accounts to CloudPanel on a single VPS follows a systematic workflow: prepare both servers, export accounts with pkgacct, install CloudPanel, recreate users, restore files and databases, and verify everything before switching DNS. By following these steps you minimise downtime, retain full control over each site, and gain the performance and modern tooling that CloudPanel provides. After migration, regular backups and clear documentation keep the new environment stable and ready for future growth.

cpanel migrationcloudpanelubuntu 22.04vps migrationweb hostingdatabase backupdns managementserver administration

Try it on your own server

Follow along on a Cloud VPS with full root access, or read the step-by-step knowledge base guides.