Backing up and Restoring the vCenter Server 6.0 embedded vPostgres database

Currently i am working to design VMware Infrastructure on vSphere 6.0 for one of the customer. This is small infra with 5-6 hosts and expected growth is 10-20% in next 3-4 years. So as per requirement decided that vCenter management server will be deployed as virtual machine running in vCenter Server with an Embedded Platform Services Controller and bundled PostgreSQL database will be used as PostgreSQL database with vSphere 6.0 can support up to 20 hosts and 200 virtual machines which is full filling our requirement for next 4-5 years.

We had Design review meeting last week and question came up from customer can we backup bundled PostgreSQL database? If yes how can we Backup and Restore vCenter Server bundled PostgreSQL database.

So wanted to share with all and hope this will be useful for many.

Back Up the Embedded vCenter Server Database:-

1. Log in to vCenter Server with administrative privilege, I have logged in as Service Account used for vCenter Server.

2. Browse C:\ProgramData\VMware\vCenterServer\cfg\vmware-vpx\ folder, If you changed the default installation location it will be different for you.  B1

3. Locate the vcdb.properties file in the C:\ProgramData\VMware\vCenterServer\cfg\vmware-vpx\ and open the file in a text editor.B3

4. In the vcdb.properties file, locate the password of the vc database user and record it as we need it while will take backup.B4

5. Download the Windows back up and restore package windows_backup_restore.zip attached to KB article (2091961) and unzip it on the host machine.B5

6. After unzip you can see that are 2 python scripts, One for Backup and another for Restore.B6

7. Once download and unzip done, we are good to go to run the command to take Backup of the database.

8. Before taking the Backup just wanted to show my current inventory setup, just for the record.B7

9. Open command prompt and navigate to C:\Program Files\VMware\vCenter Server\python directory to run the backup_win.py script.

C:\Program Files\VMware\vCenter Server\python> python.exe “c:\vCenter Server\backup_win.py” -p “enter password we have recorded in step 4”  -f “c:\vcdb_backup_02july2015.bak”B8

10. When the backup completes, you can see a message that the Backup completed successfully.

11. Now backup of vCenter database has been taken, So let me modify/delete inventories entry and then will restore to get those back. As you can see in below screenshot i have deleted Cluster and Datacenter entries.B9

Restore the vCenter Server vPostgres Database:-

1. Log in to vCenter Server with administrative privilege, I have logged in as Service Account used for vCenter Server.

2. Stop the vCenter Server Service and VMware Content Library service. When you stop vCenter server service it will stop all other services dependent on vCenter Server.R1

R23. Locate the vcdb.properties file in the C:\ProgramData\VMware\vCenterServer\cfg\vmware-vpx\ and open the file in a text editor. Locate the password of the vc database user and record it as we need it while Restore the database.

4. Open Command prompt and Run restore script to Restore the database from last backup.

C:\Program Files\VMware\vCenter Server\python> python.exe “c:\vCenter Server\restore_win.py” -p “enter password we have recorded in step 3”  -f “c:\vcdb_backup_02july2015.bak”R4

R55. When the Restore completes, you can see a message that the Restore completed successfully.

6. Start the VMware Content Library service and vCenter Server Service and all other related services.

7. Connect to vCenter Server Web Client to check the status.R6

That’s All 🙂 We have done with how to Backup and Restore the vCenter Server 6.0 embedded vPostgres database. Thank you 🙂

———————————————————————————————

Reference VMware KB to Download the Windows back up and restore package/script:- http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2091961

4 thoughts on “Backing up and Restoring the vCenter Server 6.0 embedded vPostgres database

  1. You have stated (and highlighted) in the first paragraph that the Appliance’s “PostgreSQL database with vSphere 6.0 can support up to 20 hosts and 200 virtual machines”. Where did you get these numbers? The vSphere 6.0 Configuration Maximums manual states a maximum of 1,000 hosts and 15,000 VMs for the Appliance, regardless of the database type.

  2. Pingback: Backing up and Restoring the vCenter Server 6.0 with vSphere Data Protection 6 - Part 1 - Virtual Cloud Solutions

Leave a Reply

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

*