Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Hosting · Guide

What to Back Up Before Changing Hosts

What to Back Up Before Changing Hosts

Short answer

Before changing hosts, back up the WordPress database first and then the files, including wp-content, the config file and the htaccess file, and store copies off the old server. Keep 3 to 5 recent backups in different places, record the database details and DNS records, and lower the DNS TTL to 300 seconds a day before the move.

Key takeaways

  • A WordPress backup has two parts, the database and the files, and you need both to restore a site.
  • Back up the database first, then the files, and keep both parts in one backup set made at the same time.
  • Keep at least 3 to 5 recent backups, stored in different places, with one copy off the server.
  • UpdraftPlus runs on more than 4 million sites and its free version backs up to Google Drive, Dropbox and Amazon S3.
  • Lower the DNS TTL to 300 seconds at least a day before the move, and keep the old host live for 24 to 48 hours after.

What exactly needs backing up before a host change?

Back up two things: the WordPress database and the WordPress files, and keep the copies off the old server.

A WordPress site is two parts that live in different places. The database holds every post, page, comment, user and setting. The files hold WordPress core, themes, plugins, uploads and the config files.

The WordPress developer handbook on backups states it plainly: there are two parts to backing up your WordPress site, the database and the files, and you need both to fully restore a typical site.

Downloading the WordPress folder alone does not back up the database, because the database lives outside that folder in MySQL or MariaDB.

Your backup set should include:

  • The full database export, as a .sql file.
  • The full wp-content folder, with themes, plugins and uploads.
  • The wp-config.php file, which holds the database login details.
  • The .htaccess file, which holds redirect and rewrite rules.
  • Any files outside wp-content, such as custom code or static pages.

Keep at least 3 to 5 recent backups, stored in different places, such as one copy on your computer and one in cloud storage. That is the advice in the WordPress developer handbook on backups. The 3-2-1 backup rule for websites explains the same idea in more detail.

How do you back up the database first?

Export the database from phpMyAdmin or with a plugin, and save the .sql file away from the server.

The developer handbook gives a clear order: back up the database first, then back up the WordPress files. Keeping both parts in one backup set, made around the same time, keeps the files and the database in step with each other.

To export with phpMyAdmin, follow the steps in the WordPress developer handbook on backups:

  1. Open phpMyAdmin from your hosting panel and click the database your site uses.
  2. Click Export at the top of the screen.
  3. Pick the Quick method for a simple export, or Custom if you need options.
  4. If you pick Custom, select all tables, tick “Save output to a file”, pick SQL as the format, and tick “Add DROP TABLE” and “IF NOT EXISTS”.
  5. Click Go and save the file to your computer.

Check the file size when the download finishes. A database export for a small site is often a few megabytes, and an empty or tiny file means the export failed. Note the database name too, since you will need it on the new host.

Back up the database last, right before you start the move, so the copy holds the newest comments, orders and posts. The handbook says to back up your database regularly, and always before an upgrade or a move to a new location.

How do you back up the WordPress files?

Download the whole WordPress folder over SFTP, or zip it on the server first and download the archive.

The files to copy are everything in your site root: WordPress core, the wp-content folder, wp-config.php, .htaccess and any extra files. The handbook lists the same set: WordPress core, plugins, themes, images and files, plus JavaScript, PHP and other code files.

Zipping on the server is faster than downloading thousands of small files one by one.

If your host panel has a file manager, select all files in the site root, compress them into one zip, and download that single archive.

If you use SFTP, connect with a client such as FileZilla, select the site root, and download it to a folder on your computer.

Store the archive somewhere other than the old host. A backup that lives only on the server you are leaving is no backup at all if that account closes or fails. See where to store WordPress backups for storage options that keep a copy away from both hosts.

After the download, open the zip and check it holds wp-content, wp-config.php and .htaccess. A quick look inside the archive catches a failed download before moving day, when it is too late to fix.

How do you back up with a plugin instead?

Install a backup plugin, run a full backup of files and database, and send the copy to cloud storage.

A plugin does the same two jobs in one run, and it is the easiest path for most site owners. Two free plugins cover the job well, and both are listed in the WordPress plugin directory.

UpdraftPlus is the most installed backup plugin, with more than 4 million active installs according to its WordPress.org plugin page. Its free version backs up to Dropbox, Google Drive, Amazon S3, Rackspace Cloud, FTP, DreamObjects, OpenStack Swift or email.

It schedules backups every 2, 4, 8 or 12 hours, daily, weekly, fortnightly or monthly. Restoring takes three clicks from the dashboard, and the free version also migrates a site to a new host, with a built-in search-and-replace engine that fixes old URLs.

Duplicator takes a different path: it packages the files and database into a single archive with an installer file. Its WordPress.org plugin page says the free plugin handles backups of any size, encrypted archives, 1-click restore and cloud storage, and its migration wizard moves a site between domains or hosts.

The free plugin stores backups locally and on Duplicator Cloud, while scheduled backups and extra cloud providers sit in the paid Pro version.

MethodWhat it backs upNeedsBest for
phpMyAdmin plus SFTPDatabase and files, done by handHosting panel accessSmall sites, full control
UpdraftPlus freeFiles and database, on a scheduleA cloud storage accountSet-and-forget backups
Duplicator freeFiles and database in one archiveA WordPress installOne-off moves

Pick one plugin and run a full manual backup now, even if you already schedule automatic ones.

Then download the backup files to your computer as well, so you hold a copy outside both hosts. Whichever plugin you use, confirm it backs up both the files and the database, since a files-only backup cannot restore your posts.

What host and account details should you record?

Write down the database name, user and password, the PHP version, the DNS records and the login details for both hosts.

Backups restore content, but they do not record the settings around it. Before the move, collect these details in a note you can open during the migration:

  • Database name, database user and password, from wp-config.php or the hosting panel.
  • The PHP version the old host runs, since the new host should match it or run newer.
  • DNS records: the A record, any CNAME records, and the MX records for email.
  • The domain registrar login, in case you need to change nameservers.
  • Email account settings, if your mail lives on the old host.
  • Any cron jobs or scheduled tasks the site relies on.
  • The SSL certificate status, so you know whether the new host must issue a new one.

If the database name or user changes on the new host, you must edit wp-config.php to match, as the handbook notes. Write the new details down as soon as the new host creates them, so the edit is a copy job rather than a memory test.

For the move itself, the steps are in how to migrate WordPress manually. Record the details first and the migration goes much faster.

How do you lower DNS TTL before the move?

Lower the TTL on your DNS records to 300 seconds at least a day before the move, so the switch takes minutes instead of hours.

TTL, or time to live, tells other servers how long to cache your DNS records. A high TTL means the old server address stays cached for hours after you change it, so some visitors keep reaching the old host.

Cloudflare's community docs note that Cloudflare's default TTL is 300 seconds, or 5 minutes, and that nameserver propagation usually takes up to 24 hours.

The same docs suggest lowering the value from 10800 seconds (3 hours) to 300 seconds (5 minutes) before changing nameservers or records. Lowering the TTL only helps if you do it before the old value expires, so make the change at least 24 hours ahead.

Follow this order:

  1. Lower the TTL on the A record, and on MX records if email moves too, to 300 seconds.
  2. Wait at least the old TTL, so every cache has picked up the short value.
  3. Move the site and test the copy on the new server.
  4. Change the A record to the new server IP.
  5. Keep the old host running for 24 to 48 hours, since a few caches lag behind.
  6. Raise the TTL back to an hour or more once traffic has settled on the new host.

Do not cancel the old hosting plan on moving day. Keep it live until you are sure no traffic still reaches it, or a late visitor may hit a dead server.

How do you check the backup before you switch hosts?

Restore the backup somewhere safe, or at least open it and confirm the files and database are complete.

An untested backup is a guess, not a safety net. The developer handbook says most hosts back up the whole server, but getting a copy from them takes time, and a speedy recovery matters. Your own backup only helps if you know it works.

Run these checks before you change DNS:

  1. Open the backup archive and confirm it holds wp-content, wp-config.php and .htaccess.
  2. Open the database export and confirm it is a .sql file with real size, not an empty file.
  3. Check the backup date and time, and confirm it is the newest copy.
  4. If you can, restore the backup on a staging site or a local install and open the home page.
  5. Compare post counts on the restored copy with the live site.

Host backups alone are not enough for a move, since you may not get a copy in time or in a form you can use elsewhere. The guide are host backups enough explains the gaps.

The steps to prove a restore works are in how to test a WordPress backup.

What mistakes should you avoid?

The worst mistakes are backing up files only, storing the only copy on the old host, and cancelling the old plan too soon.

Avoid these six mistakes:

  • Backing up the files and forgetting the database, which holds all your content.
  • Keeping the only backup copy on the server you are leaving.
  • Moving with a backup from last month instead of a fresh one from today.
  • Changing DNS before testing the copy on the new host.
  • Cancelling the old hosting plan on moving day, before traffic has settled.
  • Forgetting email, since MX records and mailboxes need their own plan.

Make the backup, check it, and only then start the move. The steps after the backup are in how to migrate WordPress to a new host. A fresh, checked backup turns a host change from a risk into a routine job.

Frequently asked questions

Does downloading my WordPress files back up the database too?

Files and the database live in different places: the files sit in your WordPress folder, while the database lives in MySQL or MariaDB. Downloading the folder alone leaves out every post, page, user and setting. The WordPress developer handbook is clear on this point: you need both parts to fully restore a typical site.

How often should I back up my WordPress site?

For a small site that rarely changes, once a week is enough. For a busy site with daily posts, comments or orders, back up daily. Always make a fresh backup right before a host change, an upgrade or any big edit, even if a scheduled backup ran yesterday.

Can I just use my old host's backup for the move?

Yes, if it is fresh and complete. A host backup can work as a second copy, but getting it from the host takes time and you may not get it in a form you can use elsewhere. Always make your own backup before a move, and keep a copy on your computer or in cloud storage you control.

When should I lower the DNS TTL before changing hosts?

Lower the TTL to 300 seconds at least 24 hours before you change the DNS records. The old TTL sets the wait: if the old record had a 24-hour TTL, some visitors reach the old server for a full day. Lowering it early means the switch takes minutes for most people.

How do I know my backup actually works?

Restore it on a staging site or a local install and open the home page, or at least open the archive and the database file to check they are complete and recent. Compare post counts with the live site. A backup you have never opened is a guess, so prove it works before moving day.

When can I cancel my old hosting plan?

Keep the old host running for 24 to 48 hours after the switch, since a few DNS caches lag behind. If you cancel it at once, late visitors may reach a dead server. Cancel it only after you are sure no traffic still reaches the old host.

Sources

  1. Backups WordPress Developer Resources
  2. UpdraftPlus: WP Backup and Migration Plugin WordPress.org
  3. Duplicator: Backups and Migration Plugin WordPress.org
  4. DNS Tables and Propagation Time Cloudflare Community
  5. Moving WordPress WordPress Codex

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.