If the embedded vPostgres DB is used in your vCenter appliance, you should perform the VCSA 6.0 database backup on a regular basis to minimize the risk of data loss.
Performing regular database backups protect the data stored in the database because, in case of VCSA failure or replacement, without having a working DB backup, all data is lost.
To backup and restore the embedded vPostgres database from your VCSA 6.0, you need two scripts provided by VMware you can download from the VMware KB:
In addition you need to create a folder in which you want to store the backup file verifying you have read and write permissions.
Backup the vPostgres database
Using a tool like PuTTY, SSH as root your VCSA appliance and Enable BASH access with the command:
Command> shell.set --enabled True
Launch BASH shell.
Create a folder backupdb in the appliance root.
# mkdir /backupdb
To copy the two script files to the VCSA you can use a tool like WinSCP. Since the default appliance shell cannot be the remote partner of WinSCP, you may receive an error message while trying to connect the VCSA with WinSCP.
To allow WinSCP to access the VCSA, you need to change the default shell to BASH running the following command (BASH shell must be enabled and active):
# chsh -s /bin/bash root
Use WinSCP to copy the script files to /backupdb folder.
Return to the appliance shell running the command:
# chsh -s /bin/appliancesh root
Make the scripts executable with the command:
# chmod 700 backup_lin.py
# chmod 700 restore_lin.py
Run the backup_lin.py script file specifying the target location and check the result.
# python /backupdb/backup_lin.py -f /backupdb/VCSA_backup.bak
# ls -l
To store the backup in a safe place, you can use WinSCP to copy the backup file to your preferred storage.
Before restoring the VCSA DB, you need to stop the vmware-vpxd and vmware-vdcs services.
# service vmware-vpxd stop
# service vmware-vdcs stop
Run the restore_lin.py script file specifying the backup location.
# python /backupdb/restore_lin.py -f /backupdb/VCSA_backup.bak
When the restore process completes successfully, start the services previously stopped.
# service vmware-vpxd start
# service vmware-vdcs start
To keep the highest level of security and avoid data loss, you should backup the database on a daily basis.