Backup guide

Backup your BugSnag On-premise installation.

This page refers to BugSnag On-premise legacy single machine version 3. For the latest information please see BugSnag On-premise.

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 BugSnag, you need to backup both the data directory and the 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. There is a possibility of data corruption if the files are moved without first stopping BugSnag.

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 | delpaths([paths | select(.[-1] | strings | startswith("mongo_"))])' > /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 if you have any issues running a restore.