# Backups

Every database is backed up automatically each day. There is nothing to configure, schedule, or remember. PostgreSQL databases keep **point-in-time recovery** on top of the daily backups, so they can be restored to a moment, not just to last night.

## Export

The **Backup** tab exports the database as a `.sql` (or compressed `.sql.gz`) dump - the standard format `psql` and `mysql` understand. Use it for:

- An extra copy before a risky migration.
- Moving data between databases - a dump from one imports into another.
- Taking your data with you. It is a plain SQL file; nothing about it is platform-specific.

## Import

The Backup tab also imports `.sql` and `.sql.gz` dumps into an existing database.

Creating a new database? The Shared tier can import a dump **at create time** - pick the file on the create form and it loads the moment the database is ready. Dedicated instances provision for 10-20 minutes, so their imports run from the Backup tab once ready. See [Seed from dump](/create/database-settings#seed-from-dump).

If an import fails, the database survives as it was and the import can be retried from the Backup tab.

## Restore

- **PostgreSQL** can be restored to a point in time - to just before the bad migration, not just to last night's backup.
- **MySQL** restores from the daily backups.
- Any database can be rebuilt from an exported dump: create a new database, import, and repoint [`DATABASE_URL`](/platform/databases/connect#set-database_url).

> [!IMPORTANT]
> Storage can be grown without downtime but never shrunk, and restores need room. If a restore or import fails on space, grow the storage first - see [Database settings](/create/database-settings#storage).

## A move-in, step by step

Migrating an existing database onto the platform:

1. Dump it at the old provider: `pg_dump --format=plain mydb > backup.sql` (or `mysqldump`).
2. Create a [database](/create/database-settings) - on the Shared tier, attach the dump on the create form; on a dedicated tier, import from the Backup tab when it is ready.
3. Set the new connection string on your app's [environments](/platform/environment-variables).
4. Redeploy, verify, and retire the old database.

## Related

- [Databases](/platform/databases): Tiers, storage, and high availability.
- [Connect an app](/platform/databases/connect): Connection strings and per-environment databases.
- [Database settings](/create/database-settings): Seeding a new database from a dump.
