Krang Backup and Restore

Krang includes completely automated backup and restore procedures. This file explains how to use them.

Making a Backup

To make a backup of a Krang installation, use the krang_backup script:

  $ cd /path/to/krang
  $ bin/krang_backup

By default this will create a Krang Backup Archive (.kba) with a filename of the form 'krang-hostname-YYYYMMDD.kba'. For example, krang-valis-20031011.kba. You can provide your own name as an argument to krang_backup:

  $ bin/krang_backup mybackup.kba

You can also create a compressed backup with the --compress option, but beware that this can take much longer than creating an uncompressed backup:

  $ bin/krang_backup --compress mybackup.kba.gz

Full documentation for krang_backup is available by typing:

  $ bin/krang_backup --help

Or you can read it here: Krang Backup

Restoring from Backup

You can restore from a backup file using krang_install. To start, download the source for the version of Krang used to create the backup, uncompress it and enter the directory:

  $ tar zxvf krang-1.018.tar.gz
  $ cd krang-1.018

If you're unsure which version to use, you can peek inside the .kba file with tar and look at the contents of lib/Krang.pm.

Then call krang_install with the --FromBackup option. For example, to restore mybackup.kba into /usr/local/krang (the default InstallPath):

  $ bin/krang_install --FromBackup mybackup.kba

To restore elsewhere, include the InstallPath option as with a normal install:

  $ bin/krang_install --FromBackup mybackup.kba --InstallPath /path/to/krang

If you're restoring onto a different machine then you'll need to supply correct HostName and IPAddress settings on the command line:

  $ bin/krang_install --FromBackup mybackup.kba --InstallPath /path/to/krang \
                      --IPAddress 127.0.0.1  --HostName localhost.localdomain

krang_install will automatically call krang_uninstall if the target InstallPath already exists, so this procedure can be used to restore a backup over an existing installation.

Full documentation for krang_install is available by typing:

  $ bin/krang_install --help

Or you can read it here: Krang Install