Backup guide

Backup your Bugsnag On-premise installation.

Backing up

Bugsnag should be regularly backed up to ensure you are able to quickly recover in the event of a disaster. To correctly backup a Bugsnag cluster, you need to backup both the data directories on each machine in the cluster and the cluster configuration. Strategies for each are outlined below.

Backing up the data directory

If you are using a cloud provider (like AWS) and your data directory is stored on EBS or an equivalent persistent disk, you can use the snapshot function to take a point in time snapshot of the data directory. If you are not using a cloud provider, but you are using an LVM or some other file system that supports snapshots (ZFS) then it is possible that you can still take a point in time snapshot. This is the recommended way of backing up your data directory as there is no downtime for your installation.

Copying the data directory

If you stop Bugsnag via the Replicated Management Console you can use the unix command cp to copy the data directory into a resilient backup area. For example,

cp -r /data /backups/

You can then start Bugsnag using the Replicated Management Console.

It is important to stop the running instance so that the files in the data directory are consistent when making this backup.

Cluster configuration

You must also make a copy of your configuration, as it has randomly generated encryption keys which are used to secure data in your installation. If you do not back this information up, then your installation will be rendered useless if these keys are lost.

To backup the configuration, you can use the Replicated cli to export the configuration to a file in a safe place away from the machine Bugsnag is being run on.

replicatedctl app-config view | jq -MS '[ .[] | reduce .Items[] as $i ({}; .[$i.Name] = if ($i.Value | length) > 0 then { value: $i.Value } else {} end) ] | add | del(.mongo_ca, .mongo_cert, .mongo_private_key)' > /backups/config.json

This command requires jq, see this page on details for installing on your operating system.

Restoring from backup

Prepare the host

In order to restore Bugsnag, Replicated must be installed and running, but Bugsnag needs to not be running. To achieve that, follow the the instructions in the appropriate section below.

Prepare a host which has Replicated installed

Ensure Bugsnag is not running, using the Replicated Management Console.

Prepare a host without Replicated installed

If Replicated isn’t installed, install Replicated using this section of the install guide.

Install the license key using:

replicatedctl license-load < license.rli

If the license requires activation, then use the code from the email you receive in the following command:

replicatedctl license activate <Activation Code>

Restore the Bugsnag backup

Copy the data from your backup area to the data directory specified in your configurations (e.g. /data).

Then import your settings by running the following:

replicatedctl app-config import < /backups/config.json

Start Bugsnag

Open the Replicated Management Console. If you freshly installed Bugsnag you may be prompted to set a password and configure certificates.

Start Bugsnag via the Management Console and wait for the startup to complete. Please get in touch with us via support@bugsnag.com if you have any issues running a restore.