How to backup and restore of vCloud Usage Meter DB

Backup / Restore of vCloud Usage Meter DB

In this post, I explained how to backup/restore the vCloud Usage meter DB that I found through surfing, collectively it took me more than 60+ minutes to find the steps.

Any one can use this post regardless of the Usage Meter version.

 

To Backup: 


– Login to Usage Meter appliance as root  and run following commands

#su - postgres 



#cd /opt/vmware/vpostgres/xx/bin/


(xx = Version of the postgres, it varies version to version)

#./pg_dump usage_meter_db >> /tmp/dbbackup


To Restore: 

Take a snapshot of the VM before restoring

Login to Usage Meter appliance as root  and run following commands

su - postgres 



cd /opt/vmware/vpostgres/xx/bin/


(xx = Version of the postgres, it varies version to version)

./dropdb usage_meter_db


(Delete the existing DB

./createdb usage_meter_db


(Create a empty DB)

psql usage_meter_db < /tmp/dbbackup


(Restore DB)

or

sudo -u postgres </span>/opt/vmware/vpostgres/xx/bin/psql usage_meter_db &lt; /tmp/dbbackup<span> usage_meter_db


(xx = Version of the postgres, it varies version to version)

 

This post first appeared on the Virtualization Express blog at virtualizationexpress.com, by Karthic Kumar +.
Copyright © 2013 – VirtualizationExpress +. All rights reserved. Not to be reproduced for commercial purposes without written permission.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s