Database backup allows to instantly attach table/database from backups in read-only mode.
Database backup works with both incremental and non-incremental backups.
Creating a database
The backup destination can be any valid backup destination, such as Disk, S3, or File. It is passed as a function, for example Disk('disk_name', 'backup_name').
Engine Parameters
database_name_inside_backup — Name of the database inside the backup.
backup_destination — Backup destination.
Usage example
Let’s make an example with a Disk backup destination. Let’s first setup backups disk in storage.xml:
Example of usage. Let’s create test database, tables, insert some data and then create a backup:
So now we have test_database_backup backup, let’s create database Backup:
Now we can query any table from database:
It is also possible to work with this database Backup as with any ordinary database. For example query tables in it:
Last modified on July 2, 2026