BurrowGet Burrow
Everyday use

Databases & backups

Everything on this page works with MySQL, PostgreSQL and MariaDB.

Create a database#

On the Services page, a running MySQL, PostgreSQL or MariaDB card lists its databases and has a field to create one. Or:

burrow db create shop                      # MySQL
burrow db create shop --service postgres
burrow db create shop --service mariadb
burrow db list

Creating a database that already exists does nothing, so it is safe to run again.

For vector columns in PostgreSQL, turn on pgvector and run CREATE EXTENSION vector; in the database.

Browse with phpMyAdmin or Adminer#

Burrow serves two database tools as built-in sites, already signed in to your local server:

Tool For Address
phpMyAdmin MySQL https://phpmyadmin.test
Adminer PostgreSQL https://adminer.test

Press Open phpMyAdmin or Open Adminer on the service card. The first click installs the tool (it shows Install phpMyAdmin / Install Adminer until then); phpMyAdmin runs on PHP 8.3, which Burrow installs for it if needed. Click a database name on the card to open that database straight away.

burrow db open                         # the MySQL server in phpMyAdmin
burrow db open shop                    # one database
burrow db open blog --service postgres # in Adminer
burrow db open shop --print            # print the address instead of opening a browser
burrow db admin list                   # installed or not, and their addresses
burrow db admin install adminer
burrow db admin remove phpmyadmin

The tools are only reachable from your computer and are never shared through a public link. If you have linked a site called phpmyadmin or adminer yourself, your site keeps the address. MariaDB has no built-in tool; any MySQL client works with it on port 3307.

Snapshots#

A snapshot saves one database as it is right now, so you can go back to it in seconds: before a risky migration, after seeding test data, or before trying something out.

On a running database card, the Snapshots panel has a database picker, an optional name and Take snapshot. Each snapshot is listed with its size and age, with Restore and Delete.

burrow db snapshot shop --name seeded     # name is optional; default is the current UTC time
burrow db snapshots shop                  # list them
burrow db snapshots shop --delete seeded
burrow db restore shop seeded             # without a name: the newest
burrow db restore shop seeded -y          # don't ask first

Add --service postgres or --service mariadb for the other servers.

Snapshots are kept in ~/.local/share/burrow/snapshots/.

Automatic snapshots#

Burrow also takes a snapshot by itself just before something could lose data:

  • before importing over an existing database;
  • before restoring a snapshot, so a wrong restore can be undone;
  • before an AI agent runs a destructive Artisan command such as migrate:fresh.

They appear in the same list, marked with why they were taken (for example Automatic, before an import). All three are on by default. Choose which moments get one in Settings → Backups, how many automatic snapshots to keep per database (3, 5 (the default) or 10; yours are never deleted), and whether to skip databases larger than 1 GB (the default) or 5 GB, or never skip.

If the snapshot fails, nothing is changed, and you can continue without one (Import without a snapshot, or --no-snapshot on burrow db import and burrow db restore).

Export to a .zip#

Services → Database backups → Export lets you tick the databases you want (all of them by default) and choose where to save the .zip. From a terminal:

burrow db export                                   # every database → ./databases-<date>.zip
burrow db export shop postgres/blog mariadb/crm --out ~/backups/dbs.zip

Name MySQL databases as shop, PostgreSQL ones as postgres/blog and MariaDB ones as mariadb/crm.

The archive holds one plain SQL file per database (mysql/shop.sql, postgres/blog.sql, mariadb/crm.sql), so you can also open it or restore it with any other tool.

Import from a .zip#

Services → Database backups → Import opens a .zip and lists the databases inside. For each one, choose where it goes:

  • a new database: Burrow suggests a name such as shop_copy, so nothing is overwritten unless you choose to;
  • an existing database: its tables are replaced by the ones from the backup;
  • or skip it.

From a terminal, burrow db import asks the same question for each dump:

burrow db import ~/backups/dbs.zip
burrow db import dbs.zip --into shop=shop_copy --into postgres/blog=blog
burrow db import dbs.zip --yes          # every dump into a database of the same name

Big databases#

Exports, imports and snapshots stream straight between the database and the .zip, so a multi-gigabyte database uses almost no memory and never freezes the app. Progress is shown as it goes. An export is written to a temporary file and only appears under its real name once it is complete, and only you can read it.

↑ ↓ to moveEnter to openEsc to close