v1

Databases And Persistence /

Backup, restore, and import data

You can create, import, and delete backups of your database or addon from the backups page, as well as restore your database or addon from an existing backup.

Types of backup

Snapshot (disk backup)

Snapshots save the state of the whole volume. Each new disk backup you create will only store the differences from the previous snapshot.

Snapshots are the best method for regular backups as the incremental way of storing backup data is highly efficient and uses a minimal amount of storage space.

Disk backups cannot be downloaded.

Dump (native backup)

Creates a text dump of the full existing database and stores it in a zipped file. Native backups are not available for all databases.

Native backups can be downloaded.

Schedule backups

You can configure up to three separate backup schedules for each database or addon.

You can create one hourly, one daily, and one weekly schedule to meet your operational and legal requirements.

Create a schedule

You can add schedule from the backups schedule page on an addon or database to begin configuring a new backup schedule.

Choose the backup type, and how often to run the backup: hourly, daily, or weekly.

You can then configure when the scheduler will run the backup by selecting minute, hour, and day (depending on schedule frequency). You can select multiple options to create any schedule, for example daily at 1am and 1pm (01 & 13), or weekly on select days.

Retention time defines how many days a backup will be stored for.

If any backup schedules overlap, only one backup will be created at the overlapping time.

After creating a schedule you will only be able to edit the retention period. To change any other settings, delete the current schedule and create a new one.

Schedules can produce a maximum of 500 backups before any expire, you will be unable to create schedules that would produce more than this.

Backups from schedule

Backups created by schedule are available on the backups page for the database or addon, and detail the schedule they were created by. You can click on an individual backup to see more details and select retain backup forever to override the schedule's retention policy.

Create a manual backup

You can manually create a new backup from the backups page on a running database or addon. Choose the backup type and it will be immediately scheduled for creation. Check the entry on the backups page to view its status.

Import a backup

You can import a backup from a file or directly from another running database. Once imported you can restore from the saved backup.

URL or file upload

You can restore a database from a file by providing the URL to the hosted file, for example https://yourdomain.com/backups/data.db.gz, or uploading a file. If the file ends in .gz Northflank will attempt to unzip it, otherwise it will be treated as clear text. Northflank will copy the imported file, which will be used as a source when restoring the backup. Please note that when you restore from this kind of import:

  • All existing user databases will be removed. The default admin and access users and system databases will not be affected.
  • All databases from the backup source will be imported
  • The default admin and access users will have full access to the imported database. If these users have been deleted they will be recreated before restoring.
  • If the source includes user manipulation commands (create user, grant permissions), they will be executed unless they grant too many rights

Connection string

You can restore from another database by providing a connection string with relevant credentials and parameters. Northflank will create a dump from the source database which you can then restore from.

Please note that when you restore from this kind of import:

  • All existing user databases will be removed. The default admin and access users and system databases will not be affected.
  • All databases, except users, from the backup source will be imported (depending on the access of the specified user when importing by connection string)
  • The default admin and access users will have full access to the imported database. If these users have been deleted they will be recreated before restoring.
DatabaseConnection string syntax example
MongoDBmongodb://user:password@mongodb0.yourdomain.com:port
RedisCurrently unsupported
MySQL (using JDBC)jdbc:mysql://user:password@yourdomain.com:port
PostgreSQLpostgresql://user:password@yourdomain.com:port

Restore from a backup

You can restore your database or addon from a specific backup on the backups page. Select restore backup to immediately schedule a restoration.

Each listed backup displays the following information:

ColumnExplanation
NameBackup name, usually automatically generated
SourceIndicates whether the backup was created on Northflank or imported, and if it's a disk or native backup
StatusDisplays the date the backup was completed, or the status if it is in-progress
ScheduleIndicates which schedule created the backup, if any. If created by overlapping schedules, it will list all applicable.
SizeThe size of the backup. May not be displayed if the backup is too small.
Restore statusIndicates if a restore has been scheduled from the backup, is in progress, or is complete
CreatedThe date and time the backup was scheduled for creation

You can click on the entry in the list to view the backup logs, restore history, and abort scheduled restorations. Each backup has the following available actions:

ButtonAction
Download the backup as a gzip (.gz) archive file. Only available for native (dump) backups.
Restore from this backup. The restore will be immediately scheduled and executed as soon as possible.
Override the retention policy of the schedule and keep the backup forever. Only available for backups created by a schedule
Delete the backup from Northflank.

© 2022 Northflank Ltd. All rights reserved.