New feature in Juju 2.8: standalone juju-restore tool

As part of the Juju 2.8 release, juju-restore is now available as a Developer Preview.

About

juju-restore is a tool to restore a Juju backup file into a Juju controller. This may be required if a juju upgrade-model failed for some reason. In a sense, it provides rollback functionality.

A restore can work backup that was taken from an earlier Juju version when the --allow-downgrade option is passed. This means that if you take a backup before upgrading the controller, and then hit a bug in the new Juju version, you can restore the backup to get back to the original version.

This works on high-availability (HA) controllers, as long as there’s SSH connectivity from the primary controller (where you run juju-restore) to the secondary controller machines. We check for connectivity before beginning the restore, just in case.

Installation

juju-restore is written in Go and downloadable from the Releases tab of the GitHub project. To “install” juju-restore, copy the executable onto the controller machine.

# Download the latest release 
wget https://github.com/juju/juju-restore/releases/download/v0.9/juju-restore

# Switch to the controller model
juju switch -m controller

# Copy juju-restore to the machine hosting the MongoDB primary  
juju scp juju-restore 0:/home/ubuntu

Usage

juju-restore should be run on the primary controller machine in the MongoDB replica set. This is typically machine 0 in the controller model. All replica set nodes need to be healthy, in PRIMARY or SECONDARY state.

Requires backup: juju-restore requires a backup file to be in place. If you have saved a local copy, use juju scp to copy this to the controller machine.

Usage syntax:

juju-restore [--allow-downgrade] <path-to-backup>