Commands‎ > ‎

Upgrade

Checks to see if an upgrade to the HashBackup executable is available and optionally installs the new version.

$ hb upgrade [-n] [--force]

With no options, the upgrade command will check the upgrade servers to see if a newer version of HashBackup is available and will display the change log.  The change log explains changes made since the version you are currently running.  Upgrade will then ask if you want to install this new version.  If not, it exits.  If you do want to install, it downloads the executable from the HashBackup LLC upgrade servers, verifies the file signature to ensure authenticity, and installs the new version, renaming the current executable as hb.bak.

The -n option performs all of these steps, including the download and signature verify, but does not replace the hb executable.

With the --force option, upgrade performs all steps and does not ask for confirmation before installing the new version.  This is typically used in a cron job to periodically download and automatically install upgrades.  A reasonable period to check for upgrades is every week.  Adding >/dev/null after the --force option prevents a cron email when there is no upgrade available; an email will only be sent when an upgrade occurs, and it will contain the change log.

To ensure the program you are downloading is an authentic version of HashBackup, the download package is signed with a private key during the build process.  The private key is not stored on the download server.  The upgrade command uses the matching public key built in to the HB executable to verify the file signature.  This makes it nearly impossible for upgrade to install a corrupt or fake version of HashBackup.

Database Upgrades

HashBackup may do an automatic database upgrade the first time the new version is used.  If it has been a while since you have upgraded, there may be multiple database upgrades, as in the example below.  If there is any problem during the upgrade, the database is rolled back.

$ hb versions -c hb

HashBackup build #1961 Copyright 2009-2017 HashBackup, LLC


Current database rev: 24

Upgrading database to rev: 29

Copying /hb/hb.db to /hb/hb.db.orig before upgrade

  Upgrade to rev 25...

    Update directories

    Update flags

  Upgrade to rev 26...

    Update part 1

    Update part 2

  Upgrade to rev 27...

    Fix multiple C records

  Upgrade to rev 28...

    Update dest.db

  Upgrade to rev 29...

    Update stats for interrupted backups

Database upgraded to rev 29

Backup directory: /hb

... (normal hb versions output) 



Backup Compatibilty: Archives vs Backups


HashBackup is designed to be used an a backup tool rather than an archive tool.  There are frequent upgrades to HB's storage format that are handled automatically, but these make it less-than-ideal as an archive tool.  The compatibility goal is that backups created less than a year ago should be accessible with the latest version.  Backups created more than a year ago may require an older version of HB.  To ensure you have a version of HB that can access older backups, consider setting the config option copy-executable to True.
Comments