Practical steps on how to back up a WordPress site for recovery and migration

WatDaFeck RC image

Practical steps on how to back up a WordPress site for recovery and migration

Backing up a WordPress site is a straightforward habit that protects your content, settings and time in the event of an error, a hack, or a failed update.

Start by deciding which backup method suits you best and preparing access credentials for your site, hosting control panel and FTP or SFTP account when required.

There are three common approaches: use a backup plugin, perform manual backups of files and the database, or rely on your host's backup service while verifying its retention and restore policy.

To perform a safe manual file backup, connect to your server using SFTP or your host's file manager and download the wp-content folder plus root files such as wp-config.php and .htaccess, compressing them into a single archive to reduce transfer time and preserve timestamps.

  • Include wp-content/uploads, your active theme and any custom plugin folders in the archive.
  • Export or copy wp-config.php and check for non-standard files in the WordPress root directory.
  • Keep a copy of any custom cron or configuration files that live outside WordPress directories.

For the database backup, use phpMyAdmin to export your site's database as a SQL file, choosing the custom export method to include structure and data and enabling the option to add DROP TABLE statements for complete restores, or use WP-CLI with a command such as wp db export if you have shell access and prefer a scriptable approach.

If you opt for a plugin-based route, pick a reputable plugin that separates file and database backups, supports scheduled jobs and can push copies to remote storage such as Dropbox, Google Drive or an S3-compatible bucket, and remember to test a restore after initial configuration to confirm the files and database match and the process completes without error.

Automate retention and off-site storage to reduce risk, setting a schedule that reflects how often content changes and keeping multiple historical copies so you can roll back to a known good state, and ensure at least one copy is kept physically separate from your primary server for added resilience.

When you need to restore, upload the archived files back to the server, import the SQL file into a fresh database or overwrite the existing one with care, update wp-config.php if database credentials differ, and clear caches to verify the site functions correctly, and for more step-by-step guides on similar maintenance tasks see the How-To Guide collection. For more builds and experiments, visit my main RC projects page.

Comments