How to Migrate a WordPress Site: A Step-by-Step Zero-Downtime Guide
You've decided to switch hosting providers, but are you worried that your WordPress site will break during the move, your emails will be lost or your Google rankings will drop? Done in the right order, a WordPress migration can be completed without downtime or data loss.
In this guide, we walk you step by step through pre-migration preparation, plugin-based and manual migration methods, how to switch DNS without downtime, post-migration checks and fixes for the most common errors.
To migrate a WordPress site, you need to move its two parts to the new server: the files (above all the wp-content folder) and the database. You can do this with a plugin such as All-in-One WP Migration or Duplicator, or manually using FTP / phpMyAdmin / WP-CLI. Then you update the database details in the wp-config.php file, test the site using your hosts file, and finally point your domain's DNS records to the new server.
Pre-Migration Preparation
Spending a few minutes on preparation before you start prevents problems that could take hours to fix later:
- Take a full backup: Download a backup of both the files and the database to your own computer. If anything goes wrong during the migration, this is the only safe point you can return to.
- Note the versions: Find out the PHP and MySQL / MariaDB versions on the current server and choose the same or a newer version on the new server. For more on PHP versions, see our guide to upgrading your WordPress PHP version.
- Check the site size: If the wp-content/uploads folder in particular is large, you may run into the file size limits of free plugin versions.
- Lower the DNS TTL: 24β48 hours before the migration, lower the TTL of your domain's A record to a small value such as 300 seconds (5 minutes). That way, the DNS change propagates much faster.
- Don't forget email: If your email is also on the old host, it needs to be migrated separately, or the MX record must be left untouched.
- Freeze content changes: During the migration, stop new posts, orders or comments as much as possible; otherwise that data will remain on the old server.
Which Migration Method Should You Choose?
| Method | Who is it for? | What to watch out for |
|---|---|---|
| Migrating with a plugin | Small and medium-sized sites, users with little technical knowledge | Free versions may have size limits; you may hit PHP upload limits |
| Manual migration (FTP + phpMyAdmin) | Large sites, cases where the plugin fails | More steps; requires care with the database settings |
| SSH + WP-CLI | VDS / dedicated users with SSH access to the server | Requires command-line knowledge; the fastest and most reliable method |
| Panel migration / support team | Those with cPanel on both source and destination, or who prefer to leave it to an expert | Check whether your provider offers a migration service |
If both sides use cPanel, you can also move the site, database and emails in one go with a full account backup (cpmove). If you're not familiar with the cPanel interface, our cPanel beginner's guide will help.
Migrating WordPress with a Plugin
The steps below show how All-in-One WP Migration, Duplicator and similar migration plugins generally work:
Export from the old site
Install the migration plugin on your current site and use the Export option to download the site to your computer as a single file. This file contains your content, themes, plugins, media files and database.
Install a clean WordPress on the new host
In your new hosting account, install a blank WordPress with the panel's auto-installer. The admin credentials don't matter; after the import, your old site's users will apply.
Install the same plugin and import
Install the same plugin on the new WordPress and upload the downloaded file with Import. If the file exceeds the server's upload limit, increase the upload_max_filesize and post_max_size values from your hosting panel, or ask the support team for help.
Refresh the permalinks
When the import is complete, log in with your old site's username and password. Go to Settings β Permalinks and, without changing anything, click Save Changes twice. This regenerates the .htaccess rules and prevents 404 errors.
Instead of a plugin-based import, Duplicator creates an archive file and an installer.php file. When you upload these two files via FTP to the new server's empty web directory and open installer.php in your browser, the setup wizard asks for the database details and completes the migration.
Migrating WordPress Manually
Download the files
Using an FTP client (such as FileZilla) or your hosting panel's File Manager, compress and download all files in public_html (or the directory where the site lives). The most important folder is wp-content, which holds your theme, plugin and media files.
Export the database
In phpMyAdmin, select the site's database and download it in SQL format from the Export tab. You can see which database you use on the DB_NAME line in wp-config.php. If you have SSH access, these commands are faster:
# Export the database
mysqldump -u KULLANICI -p VERITABANI_ADI > yedek.sql
# Archive the site files
tar -czf site.tar.gz -C /home/kullanici/public_html .
# Or back up the database with WP-CLI
wp db export yedek.sql
Create a database on the new server and import it
In your new hosting panel, create an empty database and a user with full privileges on it. Then upload the .sql file using phpMyAdmin's Import tab, or import it over SSH:
mysql -u YENI_KULLANICI -p YENI_VERITABANI < yedek.sql
tar -xzf site.tar.gz -C /home/yenikullanici/public_html
Update the wp-config.php file
After uploading the files to the new server, replace the database details in wp-config.php with the new ones:
define( 'DB_NAME', 'yeni_veritabani' );
define( 'DB_USER', 'yeni_kullanici' );
define( 'DB_PASSWORD', 'guclu-sifre' );
define( 'DB_HOST', 'localhost' );
Update the URLs if the domain changes
If you're migrating with the same domain, you can skip this step. If there's an address change, such as a new domain or a switch from http β https, you need to update the old addresses in the database. Do this with the WP-CLI search-replace command instead of a bulk SQL replace; this command makes the changes without breaking WordPress's serialized data:
# First, see what will change in dry-run mode
wp search-replace 'https://eskialanadi.com' 'https://yenialanadi.com' --all-tables --dry-run
# Then apply the actual change
wp search-replace 'https://eskialanadi.com' 'https://yenialanadi.com' --all-tables
wp cache flush
Opening the SQL file in a text editor and replacing addresses in bulk breaks the character lengths in serialized data. As a result, theme settings, widgets and some plugin settings may be lost. Use tools that understand serialization, such as WP-CLI or Better Search Replace.
Testing and a Zero-Downtime DNS Cutover
After moving the site to the new server, test it before changing DNS. To do this, add your domain with the new server's IP address to the hosts file on your own computer; that way, the site loads from the new server only on your computer, while your visitors keep seeing the old server.
# Windows: C:\Windows\System32\drivers\etc\hosts (open Notepad as administrator)
# macOS / Linux: /etc/hosts
203.0.113.10 alanadiniz.com
203.0.113.10 www.alanadiniz.com
Replace the IP address in the example with your new server's IP address. Browse the site, log in to the dashboard, and try the forms and checkout steps. If everything works:
- Update your domain's A record (and the www record, if any) to the new server's IP address. If you also want to move your domain management, see our domain transfer guide.
- If your email is staying where it is, don't touch the MX records; if it's moving, switch the MX records after migrating the emails.
- Wait for the change to propagate. If you lowered the TTL in advance, this usually completes within minutes.
- Once testing is done, delete the lines you added to the hosts file.
- Keep the old hosting active for at least a few more days, and make sure no new data is created on the old site in the meantime.
For more on DNS record types, read our article What is DNS? A, CNAME and MX records.
Post-Migration Checklist
- β The home page, posts, category pages and images load without problems.
- β I can log in to the dashboard and I've re-saved the permalinks.
- β The SSL certificate is installed on the new server and the site loads over https.
- β Contact forms and WordPress notification emails are being sent.
- β I've cleared the cache of the caching plugin and the CDN.
- β Scheduled tasks (cron) and backup settings work on the new server.
- β I've checked crawl errors and the sitemap in Google Search Console.
If you run into SSL problems, our SSL certificate guide will help with installation and redirects. In a migration with the same domain, your URLs don't change, so a properly executed migration won't hurt your SEO rankings.
Common Errors and How to Fix Them
| Error | Possible cause | Solution |
|---|---|---|
| Error establishing a database connection | The database name, user, password or host in wp-config.php is wrong | Compare the details with the database settings in the panel; make sure the user has privileges on the database |
| The home page loads, other pages return 404 | The .htaccess file is missing or the rewrite rules weren't created | Re-save the settings on the Permalinks page |
| White screen / 500 error | PHP version incompatibility, a missing PHP extension or the memory limit | Review the PHP error logs and check the PHP version and the memory_limit value |
| Images don't appear | The uploads folder was transferred incompletely or file permissions are wrong | Re-upload the wp-content/uploads folder; set folder permissions to 755 and file permissions to 644 |
| The site keeps redirecting to the old address | The siteurl / home values in the database still point to the old address | Update the addresses with WP-CLI search-replace and clear the cache |
| Mixed content warning | Some files are still loaded over http | Replace http addresses with https in the database |
Frequently Asked Questions
Does the site go down during a WordPress migration?
Not if it's done in the right order. The site is tested on the new server via the hosts file and DNS is only changed once everything is ready, so visitors don't experience any downtime.
How long does a migration take?
A small site can be migrated with a plugin in 15β30 minutes. On large sites with gigabytes of media, the file transfer can take several hours. DNS propagation time depends on the TTL value.
Will the migration affect my Google rankings?
A migration with the same domain and the same URL structure doesn't affect rankings. In fact, moving to a faster server can help page speed. If the domain changes, you need to set up 301 redirects from the old addresses to the new ones.
Should I migrate with a plugin or manually?
If your site is small and you'd rather not deal with technical details, a plugin is enough. Manual migration is more reliable for large sites, sites that hit the plugin's size limit, or anyone with SSH access.
When should I change hosting providers?
Frequent outages, slowness and poor support are the most common reasons. We've collected the signs in our article 7 signs it's time to switch hosting providers.
Conclusion
A WordPress migration consists of taking a backup, transferring the files and database, updating wp-config.php, testing with the hosts file and switching DNS. If you lower the TTL in advance, test the site before going live and keep the old hosting active for a few days, the migration is completed without your visitors noticing. If you're not sure which type of hosting suits your site, take a look at our article what is WordPress hosting.
With Netiyo WordPress hosting plans, our expert team migrates your existing site free of charge. Move your site to its new home without downtime, with LiteSpeed Web Server, cPanel, WP Toolkit and a free SSL certificate in our data center in Turkey. For other needs, you can also explore our web hosting plans.
Explore WordPress Hosting Plans