VMware vSphere 6 release brought more robust vPostgres Database which gets installed by default when installing on Windows Server. For users willing to install the Windows version of vCenter Server 6 VMware has prepared a script which can be used to backup/restore the vPostgres Database. So in this post I'll walk you through: vSphere 6 – How To Backup vCenter 6 vPostgress Database ( On Windows)
So unless you specify external DB during the installation process,the installer will install this vPostgres database by default. The ESXi host and virtual machine limits have been increased in vCenter Server 6.0 with the vPostgres database to 20 hosts and 200 virtual machines. Previous release had this limit fixed to 5 hosts and 50 virtual machines supported with the embedded Microsoft SQL database. With 20 hosts you can do quite a lot… So in today's post I'll walk you through the process.
In one of my earlier posts I have walked you through (with a video) an installation (and some gotchas) of vCenter Server 6 on Windows server with an external SQL server Database, which can obviously can be backed up or protected with other backup tools, but in this post we will focus on smaller to middle size installations.
vSphere 6 – How To Backup vCenter 6 vPostgres Database ( On Windows)
Step 1. Connect to your vCenter server with admin rights and download the script from this VMware KB (at the bottom, file called windows_backup_restore.zip ) > put both file to the root of the c: drive to keep things simple
Step 2. Go to the %VMWARE_CFG_DIR%vmware-vpx directory and open a file called vcdb.properties > Open the file in notepad and copy the password into clipboard.
Step 3. Open command prompt and navigate to %vmware_cis_home%python and run the backup_win.py script and use the password you have copied in previous step.
The command:
python.exe c:backup_win.py -p “Nw}IO4Wgm)1P$!C” -f c:backup_of_my_vPosgressDB.bak
Result:
Restore Operations
If you need to restore vCenter vPostgres Database then similar steps has to be taken, but in addition before the restore starts, you must stop some VMware services:
Step 0:
- Stop the vCenter Server and VMware Content Library services.
- From the Windows Start menu, navigate to Start > Administrative Tools > Services.
- Right-click VMware VirtualCenter Server and select Stop.
- Right-click VMware Content Library Service and select Stop
Step 1. Go to the %VMWARE_CFG_DIR%vmware-vpx directory and open a file called vcdb.properties > Open the file in notepad and copy the password into clipboard.
Step 2. Open command prompt and navigate to %vmware_cis_home%python and run the restore_win.py script and use the password you have copied in previous step.
The command:
python.exe c:restore_win.py -p “Nw}IO4Wgm)1P$!C” -f c:backup_of_my_vPosgressDB.bak
Step 3. Start those 2 VMware services that you have stopped in step 0
Thoughts:
Even if the vast majority of backup products out there isn't supported on vSphere 6, it's just of question of the time when this compatibility will be announced. However a granular backup/restore for vCenter DB is good backup strategy as well.
As concerning the automating and different specifications on where to send those backups you can obviously you specify different destination and (or) create a daily task which would automate the backups on Windows server, but I believe that you're mastering those tasks by yourself… -:).
This VMware KB also provides backup steps for VCSA based installations.
Source: VMware KB 2091961
Parveen Garg says
Many Many Thanks vLadan……..
Alberto says
Thanks for your post.
I’ll link it from my site if you dont mind.
Bart says
I’ve had to add a backslash between those environment variables %VMWARE_CFG_DIR% and %vmware_cis_home%, and their respective subdirectory names.
james says
I wanted to implement a backup schedule for vPostgres only. We have Commvault so this will backup the actual VM every evening. However, I do not think this is adequate enough for when we move to vPostgres from SQL when we upgrade from vSphere 5.5 to 6.5U1. SQL is currently using SQL transaction logs with an interval of 15 minutes intervals.
I am interested in your opinion about whether we need more frequent backups. In my opinion it is necessary. Some of my team are telling me it is unnecessary. I know it depends on how risk savy you are. However, vCenter is the database. If you lose the DB, you lose everything
Mike says
Do you have to stop any services?