Manual
Product site My Page

Backup / Restore

Last updated · Published · Sorabun Editorial Team

Put the database and your images, themes, and plugins into one zip, back up automatically on a schedule and before updates, encrypt with a passphrase, send copies to external S3-compatible storage, and restore to that point if something breaks (with a "clean restore" that removes planted files)

Save the whole site so you can always go back

"Sorabun > Backup / Migration > Backup / Restore" takes backups of your site and restores from them (Pro, administrators only). It does the same job as BackWPup or UpdraftPlus.

A backup contains two things.

  • The database: posts, pages, settings, users, and comments (every table of this site)
  • wp-content: images and other uploads, themes, plugins, and the rest

WordPress core and wp-config.php aren't included (a restore uses the WordPress already on that server). Caches, other backup plugins' folders, server-specific add-ons (object-cache.php, advanced-cache.php, db.php), and Sorabun itself aren't included either.

No AI is used, so there are no AI costs.

Back up now

Choose "Database and files (everything)" or "Database only (posts and settings, fast)" and press "Back up now". Progress appears on the screen. When it's done, the backup is added to the list and you can download it.

Hosting servers usually cut off a single request after about 30 seconds, so the work proceeds a little at a time. It keeps going in the background even if you close the screen (Sorabun picks it up again with a request to itself and with WordPress's scheduler). Even if the server cuts a step off midway, the next step continues from the last clean point.

The zip is an ordinary zip that Windows Explorer can open. The database is stored as SQL files such as database/0001.sql, which phpMyAdmin can import as-is (so you can restore even if Sorabun stops working).

Automatic backups

"Automatic backups" backs up automatically every day, every week, or every month (on the 1st) at a set time.

SettingDefaultMeaning
Back up automaticallyOffDaily, weekly (with weekday), or monthly (1st), plus the time
ContentsEverythingDatabase and files, or database only
Copies to keep on this server3Counts scheduled backups only and deletes the oldest first. Manual backups are never deleted. With 0, backups that reached external storage aren't kept on this server
Copies to keep externally10How many to keep in external storage (scheduled backups only)
Notify on success tooOffFailures are always notified
Back up automatically before updatesOnBacks up before plugins, themes, or WordPress core are updated (see "Back up automatically before updates" below)
Check that backups can be restoredOffEvery week, loads the newest backup into temporary tables as a test (see "Check that backups can be restored" below)
Don't includeEmptyOne location per line, relative to wp-content (such as uploads/videos; * works)

WordPress's scheduler runs at the first visit after the set time. Failures are sent to the email, Slack, or Chatwork set up in Notifications, or to the administrator's email if none is set up.

Back up automatically before updates

Sites break most often right after a plugin or theme update, so a backup is taken automatically just before each update (on by default).

  • To keep updates fast, it takes only the database and the folder of the plugin or theme being updated. For WordPress core updates it takes only the database (core files can be reinstalled from WordPress.org)
  • If a backup from the last hour already contains the database and that folder, nothing new is taken. Bulk updates and automatic updates run within a few minutes of each other, so this avoids copying the same database again and again. A longer window would mean losing more posts and comments when you roll back
  • When you update several plugins at once, the first one takes the database and its own folder, and the rest take only their own folders
  • It also runs for automatic (background) updates, because a bad update can arrive at night when nobody is watching
  • If it doesn't finish within the time limit (60 seconds for updates started from the admin screens, 120 seconds for automatic updates), or if it fails, the update still goes ahead. Blocking updates would also block the ones that close security holes. Failures are recorded under "Backups before updates" on the screen
  • Installing a new plugin or theme, and translation updates, don't trigger a backup
  • These backups aren't sent to external storage. Up to 10 of them, for 7 days, are kept on this server (shown as "Automatic before update" in the list)

To roll back, choose the "Automatic before update" backup in the list and restore "Plugins" (or "Themes") together with the database.

Check that backups can be restored

A backup is useless if it turns out to be broken when you need it. Press "Check now", or turn on "Check that backups can be restored" (it runs every week, one hour after the scheduled backup), and Sorabun does the following.

  1. Picks the newest backup on this server that contains the database
  2. Loads that database into temporary tables whose names start with sbchk_ (the same loader as a real restore; your site's tables aren't touched)
  3. Checks that the number of tables and rows match the backup's record, that every table can be read, and that the site URL and the list of active plugins can be read
  4. Deletes the temporary tables. This happens whether the check passes, fails midway, or is stopped. Even if it stops in a way that loses its own progress record, the leftovers are cleaned up the next time you open the admin screens

The result appears under "Restore check". If it passes, that backup gets a "Restorable" badge in the list. If it fails, the reason (such as which table didn't match) is shown, and a scheduled check notifies you the same way a failed scheduled backup does.

Large databases are processed a little at a time, like everything else. However, the check temporarily creates a second copy of your tables inside the database, so on hosting with a database size limit, make sure you're not close to the limit before turning it on (which is why it's off by default). Encrypted backups are checked too, using the saved passphrase (only the database part is written out; the rest is only checked for damage).

Encrypt with a passphrase

"Encryption (passphrase)" encrypts your backups with a passphrase (off by default). If a copy in external storage (S3 and similar) or a downloaded file leaks, nobody can read its contents (posts, users, settings, images) without the passphrase.

If you lose the passphrase, nobody can restore your encrypted backups

Not even the makers of Sorabun. Write it on paper or keep it in a password manager. You'll also need it to restore onto a new server after the old one breaks. The settings can't be saved until you check the box confirming that you understand this.

What it protects against, and what it doesn't

  • Protects: a leak of the copies in external storage, or of downloaded files
  • Doesn't protect: someone taking over this site itself. So that scheduled backups can run without anyone typing the passphrase, it's stored on this site (encrypted with the site's key), and anyone who can get into the site can read it

How to use it:

  1. Check "Encrypt backups made from now on with a passphrase"
  2. Enter the passphrase (at least 12 characters) twice. A long sentence is easier to remember and harder to crack
  3. Check "I understand that encrypted backups can't be restored if the passphrase is lost", then save

Encrypted backups are saved as .zip.enc files. Zip tools can't open them (restore them with Sorabun). Backups made before you turned encryption on stay unencrypted. The automatic backups taken before a restore and before updates are encrypted too. When sending to external storage, the summary of contents (such as the site URL) isn't sent either.

When you change the passphrase: up to 3 previous passphrases are kept on this site (encrypted with the site's key). Backups made before the change can still be restored and checked without typing anything. To discard them, check "Forget the previous passphrases" and save. After that, to restore an older backup, enter the passphrase used at the time in "Passphrase used when this backup was made" on the restore screen. If the passphrase is wrong, nothing is changed.

How it works: the key is derived from the passphrase with Argon2id (which makes guessing cost both computation and memory), and the contents are encrypted in 1 MB pieces with XChaCha20-Poly1305. Both come from sodium, which is built into PHP. Every piece carries a tamper check, so edits, truncated files, and appended data are all detected before anything is restored. Servers whose PHP lacks sodium can't use encryption (the screen says so).

External storage (S3-compatible)

When a server breaks, only the backups stored elsewhere survive. With external storage set up, each finished backup is sent there automatically.

You can send backups to AWS S3, Cloudflare R2, Wasabi, Backblaze B2, Sakura Cloud, or any storage that works like S3. Create a bucket and an access key with your own account, then enter the following.

SettingExample
Endpointhttps://s3.ap-northeast-1.amazonaws.com (AWS Tokyo) / https://<account-id>.r2.cloudflarestorage.com (R2)
Regionap-northeast-1 / auto for R2. Left empty, it's inferred from the endpoint
BucketThe name of the bucket you created
Access key and secret keyA key that can only write, list, and delete (no permission to delete buckets is needed)
FolderWhen several sites share a bucket, give each site its own folder

"Save and test the connection" puts a small file and deletes it to confirm that writing works. The secret key is stored encrypted with this site's key and is never shown on screen.

Large zips are sent in 16 MB pieces. "Send to external storage" in the list sends one later. "Show what's in external storage" lists the stored backups, and "Bring to this server" downloads one to this server (after moving servers, or after deleting this server's copy).

Restore

Press "Restore" in the list to open the confirmation screen. Choose what to restore (database, images and uploads, themes, plugins, the rest), check "I understand", and press "Restore".

  • The current state is backed up automatically first (it appears in the list as "Automatic before restore", and the newest 2 are kept). If you want to undo the restore, restore that one
  • The database is loaded into tables with different names first and swapped in all at once only after everything has loaded. If something fails midway, the site stays as it was
  • After restoring the database, you need to log in again
  • Files are only overwritten; files added after the backup aren't deleted (to delete them, use "Clean restore" below)
  • External storage settings and your Sorabun license keep their current values
  • When a MySQL 8 collation (utf8mb4_0900_ai_ci) is restored onto MariaDB, it's replaced with one MariaDB supports
  • An encrypted backup is opened with the passphrase first. If the passphrase is wrong or the file is damaged, the restore stops without changing anything

Clean restore (removing planted files)

On a hacked site, overwriting files from a backup still leaves behind the files the attacker added (backdoors). When you restore plugins or themes, choose "Clean restore" (off by default) to delete the files that aren't in the backup.

  • Only files inside plugins, themes, and WordPress core are deleted. Core (wp-admin, wp-includes, and wp-*.php in the root) isn't in the backup, so it's compared with the official file list from WordPress.org, and files missing from that list are deleted. If the list can't be fetched, nothing in core is deleted
  • Never deleted: uploads (wp-content/uploads), wp-config.php and the wp-config-*.php files it loads, .htaccess, .user.ini, php.ini, mu-plugins, other backup plugins' folders, anything listed under "Don't include", Sorabun itself, and root files other than wp-*.php (such as wordfence-waf.php)
  • Folders that are symbolic links aren't entered, and the targets of links are never touched (before deleting, each file's real location is checked against the allowed folders)
  • For backups that contain only some folders, such as the backups taken before updates, only those folders are checked

Before anything is deleted, the number of files and the first 50 of them are shown for you to confirm. Nothing on the site changes until you choose "Delete and restore", "Restore without deleting", or "Stop" (if there's no answer within 30 minutes, the restore stops).

Deleted files are moved to wp-content/sorabun-backups/quarantine-…/date/ and kept for 30 days. .sorabun-quarantine is added to the end of each name so the files can't run as PHP. If something was deleted by mistake, remove that suffix over FTP and move the file back (list.txt shows where each file came from). After 30 days they're deleted automatically.

Plugins installed after the backup are removed too

"Clean restore" also removes plugins and themes installed after the backup (and their settings, if you restore the database as well). They appear in the confirmation list, so if you need them, choose "Restore without deleting".

Servers that don't allow changing plugins and themes

On servers with DISALLOW_FILE_MODS in wp-config.php, only images and uploads are restored from the files.

Where are backups kept?

Backups are kept in wp-content/sorabun-backups/. File names include a random string that can't be guessed, and the folder can't be listed from outside. Files moved aside by "Clean restore" are kept in this folder too (quarantine-…). Still, anything stored on the server is lost along with the server. Use external storage, or download backups from time to time.

Deleting Sorabun doesn't delete the backup files (backups are exactly what you need after deleting things). If you don't need them, delete them with "Delete" in the list or over FTP.

Multisite isn't supported.