How to move a WordPress site between cPanel accounts

Move WordPress between cPanel hosts by hand: copy the files, export and import the database, edit wp-config.php, and test before switching DNS.

4–5 minutes

If both your old and new hosts use cPanelcPanel The most popular hosting control panel: a website where you manage your email, files, databases and domains with point-and-click tools instead of commands. More about cPanel →, you can move a WordPress site with nothing but the cPanel tools, no plugin and no command line. You copy the site folder, export and import the database, then tell WordPress about its new database. This guide walks through each step and the checks that stop you losing anything.

In the old cPanel, **compress public_html in File Manager and export the database in phpMyAdmin. In the new cPanel, create a database and user, import the SQL file, upload and extract the files, then edit wp-config.php** with the new database name, user and password. Test with a hosts-file entry, then switch DNSDNS The internet’s phone book. It turns a name people can remember, like example.com, into the number address computers use to find the server. More about DNS →.

Before you begin

  • Make a full backup of the old account first.
  • Find the database name in the old wp-config.php. Look for DB_NAME.
  • Lower the TTL on the domain’s DNS a day before you switch.
  • Check both accounts use a similar PHP version. See PHP in cPanel.

If you are moving the whole account including email and every domain, the account-level transfer in cPanel to cPanel is simpler.

Step 1: Pack the files on the old host

Open File Manager in cPanel and go to the folder holding the site, usually public_html. Select all files and choose Compress, then pick Zip Archive. Download the zip. Hidden files such as .htaccess should be included; in File Manager’s Settings, tick Show Hidden Files.

Step 2: Export the database

Open phpMyAdmin from the cPanel home screen. Select the WordPress database in the left column, click Export, choose the Quick method and the SQL format, then Export. A .sql file downloads.

If the site is large, phpMyAdmin may time out. Use the Custom option and pick gzip compression, or use the manual command-line approach in how to move a WordPress site to a new host.

Step 3: Create the new database

In the new cPanel, open Manage My Databases (or MySQL Databases) and:

  1. Create a database.
  2. Create a database user with a strong password.
  3. Add the user to the database with All Privileges.

cPanel adds your account name as a prefix, such as exampleco_wp1 for the database and exampleco_user for the user. Write down all three values. The full process is in creating a database in cPanel.

Step 4: Import the database

Open phpMyAdmin on the new account, select the new empty database, click Import, choose the .sql file and run it. If the file is larger than the upload limit, compress it as a .sql.gz file, which phpMyAdmin accepts, or raise the limit.

Step 5: Upload and extract the files

In the new File Manager, go to the folder for the domain. For the first domain this is public_html; for an addon domain it is the folder you chose. Upload the zip, then Extract it. Delete the zip afterwards.

Step 6: Edit wp-config.php

Open wp-config.php in the editor and change the three values to match the new database:

define( 'DB_NAME', 'exampleco_wp1' );
define( 'DB_USER', 'exampleco_user' );
define( 'DB_PASSWORD', 'the-new-password' );

Leave DB_HOST as localhost unless the new host says otherwise. Also check the table prefix line, $table_prefix, still matches the prefix of the tables you imported. A mismatch gives a “Error establishing a database connection” or an installation prompt; see that fix.

Step 7: Test before you switch DNS

Edit your computer’s hosts file so the domain points at the new server’s IP addressIP address The number address of a device on the internet, like 203.0.113.10. Computers use it to find each other, the way post uses street addresses. More about IP address →. Browse the site, log in to /wp-admin/, and check the home page, several posts, images and forms. If you only see the old site, your hosts entry is not working or the browser cachedCache A saved copy of something, kept so it does not have to be made or fetched again. Like keeping a printed copy instead of reprinting it for every person who asks. More about Cache → the old address.

Go to Settings » Permalinks and click Save Changes to rebuild the rewrite rules. This fixes most 404 errors after a move.

Step 8: Switch DNS and add HTTPS

Update the A record at your registrarDomain registrar The company you buy and renew your domain name from, and where you choose who handles its settings. More about Domain registrar → or DNS host to the new server, or change nameservers if the new host provides them. In the new cPanel, run SSL/TLS Status so AutoSSL issues the certificate, or follow SSL in cPanel.

Common problems

SymptomCauseFix
Error establishing a database connectionWrong name, user or password in wp-config.phpRe-check all three, including the cPanel prefix
Installation screen appearsTable prefix mismatch or empty databaseConfirm the import finished and check $table_prefix
404 on every page except homeRewrite rules or missing .htaccessSave Permalinks; show hidden files and re-upload .htaccess
Mixed content or no padlockOld http:// links, or no certificate yetRun AutoSSL, then search-replace http:// with https://
500 errorPHP version or a rule in .htaccess500 fix
Images missingUploads not extractedCheck wp-content/uploads exists and re-extract

Keep the old account for a few days

Leave the old account running for at least 72 hours while DNS settles. Check it for orders, comments or form entries that arrived late, then keep a final backup before you cancel it.

Would rather not do this yourself? Moving sites is part of what we do. Tell us what needs moving and we will tell you what it involves, and what it costs.

Get the next guide

One email when there is something worth reading: new guides, errors going around, and hosting changes that affect your site.

No tracking pixels, and one click to leave.

Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.