How to migrate a WordPress site to MigraCloud, step by step
Migrating a WordPress site to another host means copying the files and the database to the new server, checking that everything works, and only then pointing the domain to the new address. Done in this order, the site stays online throughout the process.
If you are a MigraCloud client, or you’re signing up for a hosting plan, our team migrates your site at no cost. If you’re not a client but need the migration service, you’ll receive a quote. If you prefer to do it yourself, the step-by-step guide is below.
Who does the migration
| Situation | How it works |
|---|---|
| MigraCloud client or signing up for a hosting plan | The migration is done by MigraCloud, at no cost |
| Not a client and only need the migration | The migration is done for a quote |
| You want to migrate it yourself | Follow the step-by-step guide in this article |
To request a migration or a quote, get in touch with us.
Before you start
Gather what you’ll need:
- access to your current host (cPanel or another panel) and to the WordPress dashboard;
- access to the cPanel of the new host;
- access to the place where the domain is registered, to change the DNS at the end;
- a list of the plugins, the theme, and the versions used on the site;
- a time with low traffic, especially if it’s an online store.
Don’t cancel your old hosting until the very end. It’s your safety net: if something goes wrong, the original site is still there.
Step 1: Back up the current site
- Download all the site files. You can do this through the cPanel File Manager (compressing the site folder into a
.zip) or via FTP, as shown in the article Creating and accessing FTP accounts in cPanel with FileZilla. - Export the database through phpMyAdmin: select the database, click Export, and download the
.sqlfile. The database name is on theDB_NAMEline ofwp-config.php. - Note the important content of
wp-config.php, such as the table prefix ($table_prefix).
Keep this copy in a safe place. It’s your fallback point.
Step 2: Choose the method
| Method | When to use it |
|---|---|
| Manual (files and database) | Any site. It’s the most predictable method and doesn’t depend on a plugin |
| Migration plugin (such as Duplicator or All-in-One WP Migration) | Small and medium sites, when you prefer a guided wizard |
Plugins package the site into a single file that you restore on the new server. They’re convenient, but the file size can hit the PHP upload limit. If that happens, see Error: The uploaded file exceeds the upload_max_filesize directive in php.ini in WordPress. The rest of this article describes the manual method.
Step 3: Prepare the new server
- In the cPanel of the new host, add the domain if it isn’t already on the account. See How to set up an addon domain in cPanel, when applicable.
- In MySQL Databases, create a database, a user, and a password, and add the user to the database with all privileges. Write down the three names. On many accounts, cPanel adds the account name as a prefix.
- Install the SSL certificate for the domain, if there isn’t one yet. See How to install SSL in cPanel.
Step 4: Upload the files
- In the File Manager of the new cPanel, open the domain’s folder.
- Upload the site’s
.zipand extract it. Check thatwp-config.phpand thewp-admin,wp-content, andwp-includesfolders are at the root of the site folder, not inside another folder. - If the file is large, uploading via FTP is usually more reliable.
Step 5: Import the database
- In the phpMyAdmin of the new host, select the database you created.
- Click Import, choose the
.sqlfile, and confirm. - If the file is larger than the phpMyAdmin limit, compress it as a
.zip, or ask support for help.
Step 6: Adjust wp-config.php
Open wp-config.php on the new server and replace the connection details with those of the new database:
define( 'DB_NAME', 'new_database_name' );
define( 'DB_USER', 'new_user' );
define( 'DB_PASSWORD', 'new_password' );
define( 'DB_HOST', 'localhost' );
On cPanel hosts, DB_HOST is usually localhost. If the new host gives a different value, use the one it specifies. Also check that $table_prefix is the same as in the old installation.
Step 7: Test before changing DNS
While the domain still points to the old server, you can view the site on the new one. The most common way is to edit the hosts file on your computer, pointing the domain to the new server’s IP address only on your machine:
- Ask the new host’s support for the server’s IP address (or find it in cPanel).
- Open your computer’s
hostsfile as an administrator (on Windows, it’s atC:\Windows\System32\drivers\etc\hosts; on Mac and Linux, it’s at/etc/hosts). - Add a line with the IP address and the domain, for example
123.123.123.123 yourdomain.com www.yourdomain.com, replacing the IP with the real one. - Open the site in your browser and test it.
- After testing, delete the line from
hosts, or your computer will keep going to the new server even after any change.
What to test:
- the homepage and the internal pages open without errors;
- the permalinks work. If they don’t, go to Settings > Permalinks and click Save Changes again, or check the
.htaccessfile: WordPress .htaccess; - images appear and the dashboard login works;
- forms submit and the email arrives;
- on an online store, the cart, the checkout, and the payment methods.
Step 8: Lower the DNS TTL and switch the servers
The TTL is how long DNS caches the old address. A low TTL makes the change spread faster.
- A few hours (or a day) before, lower the domain’s TTL where DNS is managed.
- When the test is approved, change the domain’s DNS to the new server. This can be done by changing the name servers (DNS) or the domain’s
Arecord, depending on your setup. - If the domain’s email is on the old host, migrate the email accounts too before changing the DNS, or keep the mail (MX) records pointing to where they are today. Without this, email may stop arriving.
To understand redirects and domain pointing, see How to redirect a domain in cPanel.
The change takes some time to reach all visitors. During that period, some will see the old server and others the new one, so avoid changing content, orders, or comments on the site during the switch.
Step 9: Check after the switch
- Open the site in a private (incognito) window and on another device, to see what visitors see.
- Confirm that SSL is active, with no security warning.
- Send and receive a test email.
- Make a full backup of the site now that it’s on the new server.
- Keep the old hosting for a few days, until you’re sure the DNS has updated and everything is working. Only then cancel it.
Common problems
| Symptom | Likely cause |
|---|---|
| “Error establishing a database connection” | Wrong database details in wp-config.php |
| All internal pages return a 404 error | Permalinks or a missing .htaccess file |
| Site without styling or with broken images | Incorrect site address (siteurl and home), or mixed content between http and https |
| 500 error or white screen | Different PHP version, incompatible plugin. See 500 error or white screen in WordPress |
| The new site shows the old content | DNS or the hosts file still points to the old server |
Frequently asked questions
Does MigraCloud migrate my WordPress site?
Yes. For clients, and for those signing up for a hosting plan, the migration is done at no cost. For those who aren’t clients and only need the service, the migration is done for a quote. Get in touch with us to request it.
Will my site go offline during the migration?
It doesn’t have to. If you test the site on the new server before changing the DNS, the old site keeps working until the switch. After the switch, the change spreads gradually, and the site stays online on both servers during that period.
How long does it take for DNS to update?
It depends on the configured TTL and on each visitor’s provider. In many cases, the change shows up within a few hours; in others, it can take a day or more. Lowering the TTL before the migration helps.
Can I migrate using only a plugin?
Yes. Migration plugins package the site and restore it on the new server. The limits are the file size and the PHP version. If the plugin fails, the manual method, with files and database, will solve it.
What about the domain’s email? Does it move along with the site?
Not automatically. Email stays where the accounts are. If they’re on the old host, migrate them before changing the DNS, or keep the email (MX) pointing where it is. Changing the DNS without this care can stop emails from arriving.
Should I cancel the old hosting right after the migration?
No. Keep it for a few days, until you’ve confirmed that the site, the email, and the DNS are working on the new server. It’s how you can go back if something goes wrong.