Outgrown your web hosting or reseller plan? This guide explains how to move your websites to a VPS without losing data, orders or email. How you do it depends on the type of VPS you're moving to: a Managed cPanel VPS, where we look after the server, or a self-managed Cloud VPS, where you set everything up yourself.

The Cloud VPS steps work on every operating system we offer: Ubuntu 22.04, 24.04 and 26.04, Debian 12 and 13, AlmaLinux 8, 9 and 10, and Rocky Linux 9 and 10.

Which path is yours?

  • Moving to a Managed cPanel VPS: your sites stay on cPanel, so they move across with their settings, email accounts and passwords. Follow Path A.
  • Moving to a Cloud VPS without cPanel: you rebuild each site on a web server you set up yourself. Follow Path B.
  • Moving to a Cloud VPS where you've installed cPanel yourself (see How to manually install cPanel): you have full access to WHM, so you can use the cPanel-to-cPanel tools in Path A yourself.

Before you move: make a checklist

Log in to cPanel on your current hosting and write down:

  • Websites and domains: every domain, addon domain and subdomain you host.
  • PHP version: shown in MultiPHP Manager. Also note any custom PHP settings, such as memory_limit or upload_max_filesize.
  • Databases: each database, its user, and which site uses it.
  • Cron jobs: listed under Cron Jobs. Copy each command and its schedule.
  • .htaccess rules: redirects, rewrites and password-protected folders. Nginx doesn't read .htaccess files, so these need converting on a Cloud VPS.
  • Email: email accounts, forwarders and filters, and anything on your sites that sends email, such as contact forms and shop notifications.
  • DNS records: a copy of every record in your DNS zone, including MX, SPF, DKIM, DMARC and any verification TXT records. See Manage DNS records with the Zone Editor and Where is my DNS managed?

Path A: Moving to a Managed cPanel VPS

cPanel accounts can be copied between cPanel servers with WHM's Transfer Tool, or restored from a full cPanel backup. Either way, the website files, databases, email accounts and messages, DNS zone, cron jobs and settings come across together.

  1. Open a support ticket to ask about moving your sites. Tell us which hosting or reseller accounts you'd like moved and which VPS they're going to. If you're on reseller hosting, list the accounts, or say if it's all of them.
  2. Keep your own copy of each account before anything changes. See Download a full backup of your hosting account. If you have many accounts, cPanel's Backup can send each one by FTP instead of downloading it. See Transferring cPanel accounts from other hosts.
  3. Once the accounts are on your VPS, your domains need to point to its IP address. The switch-over works the same way as moving to us from another host: pause changes, switch DNS, then check everything. See Moving your website and email to Hoopla Hosting.
  4. Keep your old hosting until you've checked every site and mailbox on the VPS.

Path B: Moving to a self-managed Cloud VPS

Without cPanel, you can't restore a cPanel backup directly. Instead, you set up a web server and move each site's files and database across yourself. Move one site at a time.

Step 1: Take a full backup

Download a full backup of your hosting account and keep it somewhere safe. See Download a full backup of your hosting account. It's your fallback if anything goes wrong. Inside it, your website files are in the homedir folder, and each database is a .sql file in the mysql folder.

Step 2: Set up your web server

Use the same PHP version as your hosting where you can, and install the PHP extensions your sites need.

Step 3: Copy your files

Make a folder for the site, then copy the files in one of two ways. First install rsync if it's missing: sudo apt install -y rsync (Ubuntu/Debian) or sudo dnf install -y rsync (AlmaLinux/Rocky).

Option 1: copy straight from your hosting with rsync. This works if SSH access is enabled on your hosting account. Run this on your VPS, replacing cpuser with your cPanel username and OLD_SERVER with your hosting server's name:

sudo mkdir -p /var/www/example.co.nz
sudo rsync -avz cpuser@OLD_SERVER:public_html/ /var/www/example.co.nz/

If your hosting uses a different SSH port, add -e "ssh -p PORT" after -avz.

Option 2: upload your backup. Upload the backup file to your VPS with SFTP, for example with FileZilla, then extract it and copy the site's files across:

cd /root
tar xzf backup-DATE_cpuser.tar.gz
sudo mkdir -p /var/www/example.co.nz
sudo rsync -a backup-DATE_cpuser/homedir/public_html/ /var/www/example.co.nz/

Then give the web server ownership of the files:

Ubuntu/Debian

sudo chown -R www-data:www-data /var/www/example.co.nz

AlmaLinux/Rocky

sudo chown -R nginx:nginx /var/www/example.co.nz
sudo restorecon -Rv /var/www/example.co.nz

On AlmaLinux/Rocky, folders your site writes to, such as wp-content, also need the SELinux permissions shown in Step 5 of the LEMP guide.

Step 4: Move your databases

Use the .sql file from your backup, or export the database with phpMyAdmin in cPanel. On the VPS, create a database and user, then import the file, replacing the names and password with your own:

sudo mariadb -e "CREATE DATABASE example_db DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
sudo mariadb -e "CREATE USER 'example_user'@'localhost' IDENTIFIED BY 'ChooseAStrongPassword';"
sudo mariadb -e "GRANT ALL PRIVILEGES ON example_db.* TO 'example_user'@'localhost';"
sudo mariadb example_db < example_db.sql

On cPanel, database and user names start with your cPanel username, such as cpuser_wp. You can use the same names on the VPS or choose new ones.

Step 5: Update your configuration

  • Database details: update the database name, user, password and host in your site's configuration. For WordPress, that's DB_NAME, DB_USER, DB_PASSWORD and DB_HOST (localhost) in wp-config.php.
  • File paths: sites on cPanel live in /home/cpuser/public_html. Find any hard-coded paths with sudo grep -rl "/home/cpuser" /var/www/example.co.nz and change them.
  • .htaccess rules: turn important redirects and rewrites into Nginx configuration. WordPress's standard rules are already covered by the LEMP guide.
  • PHP settings: set any custom values you noted, such as memory_limit, in PHP's configuration on the VPS.
  • Cron jobs: recreate them with sudo crontab -u www-data -e (Ubuntu/Debian) or sudo crontab -u nginx -e (AlmaLinux/Rocky). Update the paths, and use /usr/bin/php rather than cPanel's PHP path. Install the php-cli package if php isn't found.

Step 6: Test before switching DNS

You can preview the site on your VPS before anyone else sees it, by telling your own computer to use the VPS for your domain. Add this line to your computer's hosts file:

YOUR_SERVER_IP example.co.nz www.example.co.nz
  • Windows: open Notepad as administrator, then open C:\Windows\System32\drivers\etc\hosts.
  • macOS or Linux: run sudo nano /etc/hosts.

Browse the site, log in to its admin area, and submit a form. Your browser may show a certificate warning, because the SSL certificate can't be issued until the domain points to the VPS. That's expected. Remove the line from your hosts file when you've finished testing.

Step 7: Lower your DNS TTL a day before

At least 24 hours before you switch, lower the TTL on the records you'll change, such as the A records for example.co.nz and www, to 300 seconds (5 minutes). The switch then takes effect much faster.

Step 8: Switch DNS and add SSL

  1. If your site takes orders or form entries, pause changes, then export and import the database again just before you switch, so nothing is lost.
  2. Change the A records for your domain and www to YOUR_SERVER_IP. Leave the MX and other email records alone unless you're moving your email too (see below).
  3. Check the change with dig +short example.co.nz. Once it shows your VPS IP address, add your SSL certificate with sudo certbot --nginx -d example.co.nz -d www.example.co.nz. See Free SSL certificates with Let's Encrypt and Certbot.

Step 9: Keep your old hosting until everything's confirmed

Leave your old hosting running until you've checked every site, form and mailbox on the VPS for a few days. Take a final backup before you cancel it, and make sure it isn't still managing your DNS or email.

What about email?

Decide what happens to your email before you switch anything:

  • Keep it on your cPanel hosting. This is the easiest option. Only change the A records for your websites, and leave the MX record, the mail record and your email TXT records as they are. You'll need to keep a hosting plan for your email.
  • Move it to an email service, such as Microsoft 365 or Google Workspace. They look after spam filtering and deliverability for you. Move your mailboxes first, then change your MX records.
  • Run your own mail server on the VPS. This is possible, but it's the hardest option, and real ongoing work. See our guide Send email from your VPS: port 25, reverse DNS, SPF, DKIM and testing.

Whichever you choose, your websites' contact forms need a way to send email from the VPS. The easiest is to have your site send through SMTP using an email account or an SMTP relay service, and add it to your SPF record.

Troubleshooting

  • 502 Bad Gateway: Nginx can't reach PHP. Check PHP-FPM is running and the socket path in your Nginx configuration, as in the LEMP guide.
  • "Error establishing a database connection": the database details in your site's configuration don't match what you created in Step 4.
  • The home page works but other pages show 404: your .htaccess rewrite rules haven't been converted to Nginx.
  • You still see the old site after switching: remove the line from your hosts file, and wait for the old TTL to expire. Check with dig +short example.co.nz.
  • Email stopped arriving: an MX or mail record was changed. Put it back using the copy of your DNS records from your checklist.
  • Uploads fail: check the file ownership in Step 3, and on AlmaLinux/Rocky, the SELinux permissions.

Related guides

Need help?

Moving to a Managed cPanel VPS? Open a support ticket to ask about moving your sites.

Our Cloud VPS plans are self-managed, so you're responsible for installing, securing and maintaining the software on your server. If something on our side isn't working, such as the network, or your VPS won't boot, open a support ticket. New to your VPS? Start with our Cloud VPS Getting Started Guide.

Was this answer helpful? 0 Users Found This Useful (0 Votes)