=== Better Database Backups by Quintaphon ===
Contributors: quintaphon
Donate link: https://buymeacoffee.com/quintaphon
Tags: backup, database backup, restore, migration, scheduled backup
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Database and whole-site backups on a schedule, one-click restore, and an installer that moves a site to a new host or domain.

== Description ==

Better Database Backups by Quintaphon backs up your database on a timer you choose, makes whole-site backups when you need them, restores either one in a click, and moves a site to a new server or address with a small installer. Backups run in short steps, so they finish on cheap shared hosting with tight time limits as well as on large sites.

Plugin site: [quintaphon.com/wordpress/better-database-backups](https://quintaphon.com/wordpress/better-database-backups/)
Documentation: [quintaphon.com/docs/wordpress/better-database-backups](https://quintaphon.com/docs/wordpress/better-database-backups/)

= Automatic database backups =

* Back up the database every 12 hours, every day, every week or every month, at the time of day you pick, in your site's time zone.
* Keep the newest backups you choose and remove older ones automatically. Mark any backup as kept and it is never removed.
* A separate schedule for whole-site backups, for example the database every day and the whole site every week.
* A missed run (because the server was busy) is tried again a few minutes later.

= Backups of files and database =

* Database only, whole site, or exactly the parts you pick: database, plugins, themes, media uploads, other wp-content files, WordPress core files, and other folders in the site folder.
* Caches, backups of other plugins, development folders and log files are left out by default. Leave out files above a size you set.
* Only the tables of this site are backed up when several sites share one database, or every table if you prefer.
* Archives are standard .tar.gz files (database backups are .sql.gz), so you can open them with any archive tool.
* Every backup runs in steps of a few seconds through the browser, or in the background with the page closed.

= One-click restore =

* Restore the whole backup or only some parts of it, such as just the database or just the media uploads.
* The database of the backup is imported next to the live one first and switched in at the end, in one step. If anything goes wrong before that, the live site has not changed.
* A backup of the current database is made first, so you can always go back.
* You stay signed in after a restore when your account is the same in the backup.
* Upload a backup made on this site earlier, of any size, in small pieces that pass any upload limit.

= Move a site to a new host or domain =

* Download a whole-site backup and its installer.php, upload both into the empty folder on the new server, open installer.php and follow five short steps.
* The installer unlocks with a key shown on the old site, checks the new server, imports the database into the one you name, changes every address and folder in the database (serialized data included), and writes wp-config.php.
* Change the table prefix during the move.
* When it ends, the installer deletes itself and the backup file.

= Email alerts =

* An email when a backup or restore fails, or after every run.
* Optionally email small database backups to yourself, so a copy is kept away from the server.

= Made for real hosting =

* Works within the time limits of shared hosting; no shell access or exec() needed.
* System check: PHP limits, background runs, disk space, and whether visitors could open the backup folder.
* The backup folder is closed to visitors, and backup names end in a random id. Move it outside the web folder with one line in wp-config.php.
* Visitors see a short maintenance message while a restore runs.

= Better Database Backups Pro =

An optional add-on, sold separately on [quintaphon.com](https://quintaphon.com/wordpress/better-database-backups/#pricing), adds Amazon S3 and S3-compatible storage, Dropbox, Google Drive, OneDrive and FTP/SFTP, archive encryption, file and table filters, recovery points, restoring backups of other sites and from a URL, quick transfers to another site, cPanel database setup in the installer, search and replace, WP-CLI commands, tools for AI assistants, hourly schedules, table prefix changes, installer branding, settings transfer, salt regeneration, user permissions, incremental backups, staging sites, a database optimizer, media cleanup, an activity log, and multisite networks with single-site export. This plugin works fully on its own and contains no code of the add-on.

== Installation ==

1. Upload the `better-database-backups` folder to `/wp-content/plugins/`, or install it from **Plugins > Add New**.
2. Activate it.
3. Open **Backups** in the admin menu. The database is backed up every day at 03:00 from the start; the dashboard checklist shows what else to set up.

== Frequently Asked Questions ==

= Where are my backups stored? =

In `wp-content/uploads/better-database-backups/`, closed to visitors. To keep them elsewhere on the server, for example outside the public web folder, add `define( 'QBDB_BACKUP_DIR', '/path/to/folder' );` to wp-config.php.

= Is a backup on the same server enough? =

No. If the server fails, its backups are lost with it. Download a whole-site backup now and then, email database backups to yourself under **Storage**, or send backups to cloud storage with Pro.

= My host stops long requests. Will backups finish? =

Yes. Backups and restores work in steps of 20 seconds by default and continue where they stopped. Lower **Settings > Seconds per step** if your host is very strict.

= Scheduled backups do not run. =

WordPress starts scheduled tasks when someone visits the site. On a site with very few visits, or with `DISABLE_WP_CRON` set, ask your host to call `wp-cron.php` every few minutes. The dashboard warns you when this applies.

= Can I restore a backup of a different site here? =

Moving a site is done with the installer: download the backup and installer.php on the old site, then run the installer on the new one. Restoring another site's backup inside WordPress is part of Pro.

= What happens to this plugin's settings during a restore? =

They stay as they are now, with the history of backups and restores, so a restore never turns off your schedule.

= What is deleted when I delete the plugin? =

Unfinished work files only. Settings and the history are removed too when you turn that on under **Tools**. Backup files are never deleted with the plugin, so a reinstall finds them again.

= Does the plugin send data to Quintaphon? =

No. See External services below.

== Screenshots ==

1. Dashboard with the last backup, the next scheduled run and a checklist.
2. Making a backup: database, whole site, or the parts you pick.
3. A backup in progress, step by step.
4. The list of backups with restore, download and keep.
5. Restore: choose the parts and back up the current database first.
6. Schedules for the database and the whole site.
7. Moving a site: the installer and its key.
8. The installer on the new server.

== External services ==

Better Database Backups by Quintaphon does not contact any outside service. To run backups in the background and to test whether the backup folder is closed to visitors, it sends requests to your own site only. Email alerts and emailed backups are sent with WordPress's own `wp_mail()`, through whatever mail setup your site uses.

== Third-party libraries ==

* **Inter** variable font 4.x (latin, latin-ext), SIL Open Font License 1.1 (assets/fonts/OFL.txt). Used by the admin screens only. Source: https://github.com/rsms/inter

== Developer hooks ==

Actions: `qbdb_job_started`, `qbdb_job_finished`, `qbdb_backup_created`, `qbdb_backup_adopted`, `qbdb_backup_deleted`, `qbdb_restore_fixup`, `qbdb_restore_done`, `qbdb_settings_updated`, `qbdb_admin_enqueue`, `qbdb_section_{slug}` (adds cards to a screen).

Filters: `qbdb_modules`, `qbdb_has`, `qbdb_can`, `qbdb_menu_cap`, `qbdb_schema`, `qbdb_nav`, `qbdb_section_file`, `qbdb_job_types`, `qbdb_job_label`, `qbdb_step_seconds`, `qbdb_backup_dir`, `qbdb_backup_tables`, `qbdb_backup_roots`, `qbdb_backup_manifest`, `qbdb_backup_slug`, `qbdb_dump_where`, `qbdb_dump_rename`, `qbdb_dump_tail`, `qbdb_scan_options`, `qbdb_manual_backup_args`, `qbdb_backup_cipher`, `qbdb_deliver_step`, `qbdb_offsite`, `qbdb_restore_args`, `qbdb_restore_cipher`, `qbdb_restore_pairs`, `qbdb_restore_target`, `qbdb_preserve_options`, `qbdb_protected_paths`, `qbdb_history_entry`, `qbdb_backup_row`, `qbdb_retain_skip`, `qbdb_checklist`, `qbdb_system_checks`, `qbdb_notify_recipients`, `qbdb_installer_brand`, `qbdb_installer_config`, `qbdb_installer_code`, `qbdb_installer_multisite`.

Constant: `QBDB_BACKUP_DIR` (where backups are kept).

== Changelog ==

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.0.0 =
First release.
