cPanel

Migrate from Webmin or Virtualmin to cPanel

Move websites from a Webmin or Virtualmin server to MdmHost cPanel hosting: back up files, databases and mail, restore them in cPanel and switch DNS without downtime.

IntermediatecPanel hosting4 min read

A Virtualmin to cPanel migration takes your sites off a self-managed Webmin or Virtualmin VPS and onto managed cPanel hosting, where updates, backups and security are handled for you. Webmin or Virtualmin backups are not in cPanel's format, so you copy files, databases and email separately and rebuild each site in cPanel.

Before you start

  • Webmin or Virtualmin admin login and SSH root access to the server.
  • An MdmHost cPanel account (see web hosting) or a reseller plan if you host several customers.
  • An inventory of sites, databases, mailboxes, cron jobs and DNS records.

Take a full backup on Webmin or Virtualmin

  1. In Virtualmin open Backup and Restore → Backup Virtual Servers.
  2. Select the servers, all features (home directory, databases, mail, DNS) and a local destination such as /root/backups/.
  3. Choose one file per server and run the backup; download the archives over SFTP.

Where Webmin or Virtualmin keeps the data

ItemTypical path
Website files/home/domainuser/public_html
Mail/home/domainuser/homes/ or Maildir
DNSBIND zones under /var/lib/bind/ or /var/named/

Make plain copies of each site over SSH; they restore anywhere:

tar -czf /root/site-files.tar.gz -C /path/to/document-root .
mysqldump --single-transaction --routines dbname > /root/dbname.sql

Virtualmin to cPanel migration: restore in cPanel

  1. Add each extra domain under cPanel → Domains → Domains.
  2. Upload the tar file in File Manager to the domain's document root and extract it.
  3. Create databases and users in Databases → Manage My Databases and import the dumps in phpMyAdmin, or over SSH as in mysqldump backup and restore.
  4. Update database names, users and passwords in each app's config file.
  5. Large sites copy faster with rsync straight from the VPS: rsync guide.

Migrate email with IMAP sync

Mailboxes rarely restore cleanly between different control panels, so the dependable method is to create the same addresses in cPanel → Email → Email Accounts and copy the messages over IMAP:

  1. List every mailbox on Webmin or Virtualmin with its approximate size.
  2. Create the same addresses on cPanel and give each enough quota.
  3. Run an IMAP sync per mailbox from the old server (by IP or hostname, since DNS still points there) to the new one. imapsync between servers explains the command; migrate email to cPanel over IMAP covers the cPanel side.
  4. After the DNS switch, run the same sync again. imapsync skips messages it has already copied, so the second pass only picks up mail that arrived in between.

Tip: Forwarders, autoresponders and filters are not copied by IMAP. Note them down on the old panel and recreate them under cPanel → Email.

Recreate DNS records

If Virtualmin ran BIND for the domain, open the zone under Server Configuration → DNS Records. Copy custom TXT, CNAME, SRV and verification records into cPanel → Zone Editor; leave out old A and MX records.

Switch DNS with minimal downtime

  1. One or two days before the move, lower the TTL of the A, AAAA and MX records at the current DNS host to 300 seconds. See DNS TTL strategy for a server migration.
  2. Test the new copy before switching: add the new server IP for the domain to your computer's hosts file and browse the site.
  3. Freeze changes on the old site (no new orders, posts or comments), take a final database export and import it on cPanel if content has changed since the first copy.
  4. Either point the A records to the new IP, or change the domain's nameservers to the ones in your MdmHost welcome email. Changing records is faster when the TTL is already low; nameserver changes can take up to 24–48 hours.
  5. Keep the old account running for at least a week so slow resolvers and delayed mail still land somewhere.

Post-migration checks

  • The site loads over HTTPS with a valid certificate. AutoSSL issues it once DNS points to MdmHost; run it from cPanel → Security → SSL/TLS Status if needed.
  • Forms, logins, checkouts and uploads work, and there are no database connection errors.
  • Sending and receiving email works from webmail and from your mail client, and SPF/DKIM pass in cPanel → Email → Email Deliverability.
  • Cron jobs are recreated under cPanel → Advanced → Cron Jobs with the new paths (/home/username/…).
  • The PHP version in cPanel → Software → MultiPHP Manager matches what the old server used.

FAQ

Can cPanel import a Virtualmin backup?

No; extract the archive and import the files and dumps as shown. (Virtualmin can import cPanel backups, but not the other way round.)

Plain Webmin with no Virtualmin?

Follow the same steps; locate sites through the Apache or nginx configuration.

Can I keep the VPS as a backup?

Keep it for about a week after the switch, take a final snapshot and then cancel it.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.