Backup and restore VCDB on windows

To backup the postgres database manually on windows

C:\Program Files\VMware\vCenter Server\vPostgres\bin>pg_dump.exe -d VCDB -U vc > VCbackup.bak

To restore

C:\Program Files\VMware\vCenter Server\bin>service-control –stop –all
C:\Program Files\VMware\vCenter Server\bin>service-control –start vPostgres

C:\Program Files\VMware\vCenter Server\vPostgres\bin>psql -d VCDB -U vc
psql (9.3.9 (VMware Postgres 9.3.9.0-2921310 release))
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page “Notes for Windows users” for details.
Type “help” for help.

VCDB=>
VCDB=> drop schema vc cascade;
………….
VCDB=> create schema vc;
CREATE SCHEMA
VCDB=>

VCDB=> create schema vc;
CREATE SCHEMA
VCDB=> \q

C:\Program Files\VMware\vCenter Server\vPostgres\bin>psql -d VCDB -U postgres -f backuplast.bak
C:\Program Files\VMware\vCenter Server\bin>service-control –stop –all
C:\Program Files\VMware\vCenter Server\bin>service-control –start –all

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