(Updated) VMware Vcenter Appliance 5.5+ Database Archiving tool

Decided to add some features and improve things a bit. In this iteration you can now backup your Inventory Service Database and restore it.  Backup Inventory “./vcdb-tool -b” or restore it “./vcdb-tool -r <inv.bak>”
You can also list the contents of your archive folder with “./vcdb-tool -l”

GitHub URL: https://github.com/jonretting/vcdb-tool

git clone git@github.com:jonretting/vcdb-tool.git
Sample Output:

INFO:

  • Tested on Vcenter Appliance 5.5d and 5.5e
  • Works only on an embedded local Postgres Database
  • When using the “-p” purge option a value of “30” would delete all archives over 30 days old
  • Edit “vcdbt_backup_dest” variable to change backup destination path

OPTIONS:

vcdb-tool [-e] [-i=file] [-p=#]
-e    Export a backup archive to the backup path
-i    Import the specified backup file from the backup path (-i file.bak)
-b    Backup the Inventory Service database
-r    Restore an Inventory Service database archive (-r file.bak)
-l    List contents of archive folder
-p    Purge outdated backup archives older than # days (-p 30)
-h    this cruft

EXAMPLES:

  • Run a PostGres Database Export ./vcdb-tool -e
  • Run a PostGres Database Import ./vcdb-tool -i VCDB.db.042615.1430061195.bak
  • Run an Inventory Service Backup ./vcdb-tool -b
  • Run an Inventory Service Restore ./vcdb-tool -r inv-backup.042615.1430061173.bak
  • List archive folder contents ./vcdb-tool -l
  • Cleanup old backup archives older than thirty days ./vcdb-tool -p 30

Based on official VMware KB-2034505 and KB-2062682

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>