Point-in-time recovery (PITR) backups¶
PITR maintains versions of your database from past timestamps, serving as a safeguard against data loss during various disasters, including database crashes, accidental data deletions, table drops, or unintended updates to multiple fields instead of a single one.
PITR complements on-demand and scheduled backup strategies by providing finer backup granularity with more specific recovery points for restoring data to the same cluster.
How it works¶
Restoring databases up to a specific moment in time involves retrieving data from a backup snapshot and replaying all subsequent events that occurred until a specified moment using log slices.
When PITR and backups are enabled (either on-demand or scheduled), Percona Everest starts capturing successive database logs at predefined intervals. As soon as the initial full backup is available, Everest can start restoring the database from these PITR logs.
Since Everest saves logs and streams them into your storage between scheduled task runs, scheduling frequent backups is not necessary. You can use the available logs in your storage to restore a backup to any moment between snapshots.
PITR upload intervals¶
By default, Everest uploads PITR logs every minute for MySQL databases and every ten minutes for MongoDB databases. If you wish to adjust these default intervals, you can easily do so through the Everest API.
Enable Point-in-time recovery¶
Prerequisites¶
Before enabling PITR, go to Settings > Backup Storages and check that you have an available S3-compatible location for storing backups. Otherwise, create a backup location so Everest can store PITR artifacts for the database.
To enable PITR:
- On the Everest homepage, click Create database to display the database creation wizard.
- Fill in the details of your database on the first steps of the wizard.
- Navigate to the Backups page, and make sure to enable and configure a backup schedule.
- Click Next to go to the Point-in-time recovery (PITR) page where you can enable PITR and specify a location for storing the PITR backups and logs.
- Complete the setup wizard to create the new database with PITR enabled.
- On the Databases view page, select the database for which you want to enable PITR. The Overview tab will be displayed.
- Navigate to Backups & PITR > Point-in-time Recovery (PITR) widget.
- Click Edit. The Edit PITR pop-up will be displayed.
- Toggle the switch on or off based on whether you want to enable or disable PITR. Click Save.
Limitations¶
There are some limitations associated with the PITR functionality. For a comprehensive list of known limitations, see the known Limitations section.
Next step¶
Get expert help¶
If you need assistance, visit the community forum for comprehensive and free database knowledge, or contact our Percona Database Experts for professional support and services.