Backup and Restore

Configuration

FileSystem Backup

The following configuration is used for a filesystem backup. The backup directory can be located on a shared drive or be a local drive. If the directory is shared you must specify this with the "sharedDirectory" setting.

{
    "dataDirectory": "$HOME/db-data",
    "installDirectory": "$HOME/sonicbase",
    ...
    "backup": {
        "type": "fileSystem",
        "directory": "$HOME/db-backup",
        "sharedDirectory": true,
        "maxBackupCount": 10,
        "cronSchedule": "0 0 * * *"
    }
}

AWS Backup

The following configuration is used for the AWS backup. Files will be backed up to S3 using the specified bucket and prefix.

{
    "dataDirectory": "$HOME/db-data",
    "installDirectory": "$HOME/sonicbase",
    ...
    "backup": {
        "type": "AWS",
        "bucket": "bucket-name",
        "prefix": "backups",
        "maxBackupCount": 10
        "cronSchedule": "0 0 * * *"
    }
}

In order for AWS integration to work you must have a file named "<cluster>-awskeys" located in the "keys" subdirectory of the install directory. This file contains the accesskey on the first line and the secret key on the second line.

maxBackupCount

The maxBackupCount setting allows you to specify how many backups you want to keep. The most recent n backups are kept after doing a backup.

cronSchedule

Restore

To restore a backup, in the administration client type "start restore <backupDir>". Where "backupDir" is the name of the backup directory to restore. If the following is your actual direcotry:

    /mnt/db-backups/2017-06-17T20:52:10.000Z

Then you would specify "2017-06-17T20:52:10.000Z" as the directory to restore.

Commands

Start Backup

To manually start a backup, in the admin client type "start backup".

Backup Status

To check if the the progress of the backup, in the admin client type "backup status".

Start Restore

To restore a backup, in the admin client type "start restore <directory>". Directory is the subdirectory of the backup, which is a date.

Restore Status

To check if the progress of the restore, in the admin client type "restore status".