Documentation Version: er2.0.28-docs-1.1

Restoring Backups

Set up automatic backups on the Server Information page. See Server Information.

To restore ER2 from a backup:

  1. Stop ER2
  2. Restore the Backup file
  3. Restart ER2

Stop ER2

In the Master Server console, run as root:

/etc/init.d/er2-master stop

This command stops ER2 from running and releases the lock from the root.kct file or root.rdbdatabase folder.

Restore the Backup File

Restore To root.kct

  1. Rename the existing root.kct file:

    mv /var/lib/er2/db/root.kct /var/lib/er2/db/root.kct.orig
  2. Run the er2-recovery command:

    # Where '/tmp/er2-backup.bak' is the backup file to recover ER2 from er2-recovery -b /tmp/er2-backup.bak -w /var/lib/er2/db/root.kct

     

    To recover or restore a kct file instead of a bak file, run:

    # Where '/tmp/er2-backup.kct' is the backup file to recover ER2 from. er2-recovery -i /tmp/er2-backup.kct -w /var/lib/er2/db/root.kct
  3. Give ER2 ownership of the root.kct file.

    chown erecon:erecon /var/lib/er2/db/root.kct; chmod go-r /var/lib/er2/db/root.kct
  4. (Optional) Once the restore operation has been verified to be successful, the original database file /var/lib/er2/db/root.kct.orig may be deleted.

Restore To root.rdb

  1. Rename the existing root.rdb folder:

    mv /var/lib/er2/db/root.rdb /var/lib/er2/db/root.rdb.orig
  2. Run the er2-recovery command:

    Running this command overwrites the existing root.rdb database folder.

    To recover or restore from a bak file:

    # Where '/tmp/er2-backup.bak' is the backup file to recover ER2 from er2-recovery -b /tmp/er2-backup.bak -w /var/lib/er2/db/root.rdb

    To recover or restore from a kct file:

    # Where '/tmp/er2-backup.kct' is the backup file to recover ER2 from. er2-recovery -i /tmp/er2-backup.kct -w /var/lib/er2/db/root.rdb

    To recover or restore from a rdb folder:

    # Where '/tmp/er2-backup.rdb' is the backup folder to recover ER2 from. er2-recovery -i /tmp/er2-backup.rdb -w /var/lib/er2/db/root.rdb
  3. Give ER2 ownership of the root.rdb database folder.

    chown -R erecon:erecon /var/lib/er2/db/root.rdb; chmod -R go-r /var/lib/er2/db/root.rdb
  4. (Optional) Once the restore operation has been verified to be successful, the original database folder /var/lib/er2/db/root.rdb.orig may be deleted.

Restart ER2

Start the er2-master process to restart ER2 .

/etc/init.d/er2-master start
For seamless data recovery, backups made from a specific version of ER2 must only be used to restore backup files from the same version of ER2. For example, a backup from ER 2.0.15 should be used to restore ER 2.0.15 installations.

To restore a datastore on a clean installation of ER2, install the version of ER2 that the backup is made from and restore your data, then update ER2 to the latest version.