Imports a database from an external archive or existing live database.
Required permission
Project > Addons > General > Update
Path parameters
projectId
string requiredID of the projectaddonId
string requiredID of the addon
Request body
- {object}Import using a connection string. The database will be imported from the live database located at the connection string's location.
name
stringThe name of the backup. If not provided, a default name will be generated containing the current date.min length3max length39pattern^[a-zA-Z0-9]+((-|\s|\/|:)[a-zA-Z0-9]+)*$connectionString
string requiredA database connection string.importAllDatabases
booleanDetect and import all databases. If false, attempts to import only the database specified in the connection stringcompressionType
stringThe compression algorithm for storing the imported file. Defaults to `gz`.one ofgz, zstdcustomDestinationId
stringCustom destination to store the imported backup in. If not specified, backup is stored in Northflank-managed destination.min length3max length100pattern^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$
OR
- {object}Import using an external archive. The database will be imported from an existing backup.
name
stringThe name of the backup. If not provided, a default name will be generated containing the current date.min length3max length39pattern^[a-zA-Z0-9]+((-|\s|\/|:)[a-zA-Z0-9]+)*$importUrl
string requiredA url pointing to an existing backup stored as a GNU zip (.gz) file.customDestinationId
stringCustom destination to store the imported backup in. If not specified, backup is stored in Northflank-managed destination.min length3max length100pattern^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$
API
CLI
JS Client
POST /v1/projects/{projectId}/addons/{addonId}/import
Example request
Request body
Import using a connection string. The database will be imported from the live database located at the connection string's location.
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"name":"Example Backup","connectionString":"mongodb://mongodb0.example.com:27017","compressionType":"gz"}' \
https://api.northflank.com/v1/projects/{projectId}/addons/{addonId}/importOR
Import using an external archive. The database will be imported from an existing backup.
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"name":"Example Backup","importUrl":"https://example.com/backup.db.gz"}' \
https://api.northflank.com/v1/projects/{projectId}/addons/{addonId}/importExample response
200 OK
success