- 07 May 2024
- 2 Minutes To Read
- Print
- DarkLight
- PDF
Database Backups
- Updated On 07 May 2024
- 2 Minutes To Read
- Print
- DarkLight
- PDF
Mambu allows users or API consumers that have the Download Backups (DOWNLOAD_BACKUPS
) permission to perform database backups. We recommend performing database backups using the Database Backup Mambu API v2 endpoint. In this article, we provide database backup best practices.
End of day jobs and database backup
We recommend you initiate database backups after the accounts state has been finalised for the day.
In order to be notified when this is the case, we suggest you set up an Accounts Updated webhook, for more information see EOD Accounts Updated Notification
API operations
The database backup endpoint in API v2 provides you with two operations. You may use the triggerBackup
operation to generate a database backup. For more information, see Database backup - triggerBackup.
Next, if the operation was successful, you may use the downloadBackup
operation to download the database backup. For more information, see Database Backup - downloadBackup.
Best practices
When you trigger a database backup, you may define an optional callback
URL in the request body which will be triggered when the backup process is complete. Additionally, you may define specific tables that you want to backup using the tables
array in the request body. For a list of available tables, see Data Dictionary.
Finally, if you have defined a list of tables using the tables
array and all the defined tables have a creationdate
you may also define a createBackupFromDate
value in the body of your request. The createBackupFromDate
value must be in the yyyy-MM-dd'T'HH:mm:ssZ
format.
If you have more than one terabyte of data, we strongly recommend using the tables
array and, if possible, the createBackupFromDate
property when performing a database backup to avoid timeout errors.
We recommend:
- Using API v2 to trigger the database backup instead of the Mambu UI.
- Defining the
callback
URL in order to be notified when the backup process is complete. - Performing a database backup by defining specific tables using the
tables
array to decrease the execution time for the database backup and avoid timeout errors. - Defining a
creationBackupFromDate
value, in situations where all the tables defined have acreationdate
value, to further decrease database backup execution time. - Allowing for at least 24 hours between database backups.
- Checking the response payload received at your callback URL to determine if the database backup was successful or if any errors were encountered.
If the database backup operation is successful, you will get a response payload at your callback URL similar to the following example:
{
"tenantId": "TENANT_NAME",
"result": "COMPLETE",
"domain": "TENANT_NAME.mambu.com"
"fileName": "tenant-MANUAL-DATABASE-BACKUP"
}
If the database backup operation is unsuccessful, you will get a response payload at your callback URL similar to the following example:
{
"tenantId": "TENANT_NAME",
"result": "ERROR",
"domain": "TENANT_NAME.mambu.com"
}
If the operation is unsuccessful, we recommend you make another request. In case of multiple failed database backup operations, please contact us through Mambu Support.
If you receive the error message: The provided table list is invalid. Tables which cannot be filtered by date: [table list]
, this means that you have mixed up tables that can be filtered with the createBackupFromDate
parameter with tables that cannot be filtered with this parameter. If this occurs, you can perform two separate backups: 1) tables which can be filtered; 2) tables which cannot be filtered.