How to set up automated database backup and restore on Accuweb.cloud?
The Database Backup add-on is fully compatible with both standalone and clustered (replica set) MongoDB databases on AccuWeb.Cloud. It integrates seamlessly with Backup Storage, enabling users to automatically create and store their database backups in remote storage locations for enhanced data security and reliability.
Add-On Installation
Before you install the Database Backup add-on, follow these steps to create a dedicated storage instance for your backup data:
1. Create Backup Storage:
If you don’t have an existing storage instance, you can easily create one using the dedicated Backup Storage package in the platform Marketplace. This process takes just a few minutes.
2. Configure Storage:
- In the installation window, choose between the Standalone and Cluster storage options.
- Specify the preferred number of nodes (for Cluster option) and storage size.
- Provide the following standard data:
- Environment: The environment’s domain name.
- Display Name: The environment’s alias.
- Region: The environment’s region (if multiple regions are available).
3. Click the Install button and wait a few minutes for the storage to be created. It will be automatically added to the “Backup storage nodes” group.
4. Once the storage is ready, you can install the backup add-on. Hover over your database and click the Add-Ons icon.
Locate the required Database Backup/Restore for the filesystem and the databases Add-On and click Install.
5. Provide the following data:
- Choose scheduling option:
- Backup storage – choose from the list of backup storages installed on the account.
- Number of backups – set the number of the newest backups to keep for the current database.
- Database User and Database Password – provide user credentials to access the database.
6. Click the Install button and wait a minute. You’ll see a success pop-up.
Your backup add-on is now working. Wait for the specified time for backups to be created or trigger them manually (see the section below).
Managing Add-On
After installation, the add-on provides the following options:
- Backup Now – Creates an immediate backup.
- Configure – Adjusts parameters specified during creation (schedule, storage node, quantity of backups, user credentials).
- Restore – Restores from a backup.
- Uninstall – Removes the backup add-on.
Backup Process
- A snapshot of the database is created using the standard mongodump utility.
- The snapshot is stored on the Backup Storage in a dedicated folder (named based on the backed-up database) with a distinct name (execution timestamp).
- This structure helps keep backups organized, especially when working with multiple databases.
Restore Process
- The corresponding directory on the storage server is mounted to the master node of the target database.
- The SQL dump from the required backup snapshot is restored (using the standard mongorestore utility) and applied to the database.
Restoring Database
Restoring a database from a backup will override all existing data, permanently losing any changes made since the backup was created.
To restore a database from a backup:
- Select the Restore Option: Choose the Restore option for the add-on.
- Restore from: In the dialogue window, choose the target environment (multiple options may be available if the backup add-on is used on several environments).
- Backup: Select from a list of backups for the selected environment (names contain timestamps for quick identification).
- Initiate Restore: Click Restore and confirm via the pop-up. Once initiated, the action cannot be canceled or reverted.
- Completion Notification: You will see a success notification in the dashboard upon process completion.