- 29 Jun 2023
- 2 Minutes To Read
- Print
- DarkLight
- PDF
Database Backups
- Updated On 29 Jun 2023
- 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.
You may also perform database backups using the Mambu UI, however we do not recommend this approach. For more information, see Data Migration Overview - Database Backup.
End of day jobs and database backup
We recommend you initiate database backups after the End of Day (EOD) job execution is completed. For more information about EOD jobs, see End of Day Processing and Cron Jobs.
In order to be notified when EOD jobs execution is completed, we suggest you set up an Accounts Updated (END_OF_DAY_PROCESSING_COMPLETED
) webhook. For more information, see Defining a New Webhook.
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 creationBackupFromDate
value in the body of your request. The creationBackupFromDate
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 creationBackupFromDate
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.