In my last post (Backup vCSA vPostgres database, roles and permissions) I described the creation of a vCSA vPostgres database backup and the export of all roles and permissions. Now it is time to restore the data.
To restore a previous created backup from a vCSA vPostgres database as well as the roles and permissions you need to follow these steps.
- Download and extract the linux_backup_restore.zip (Alternate VMwareKB2091961)
- Download Export and Import scripts (ExportAndImportRoles.zip) Scripts based from Alan Renouf and Luc Dekens
- If you don’t have, install the VMware Power CLI and PowerGUI to execute Powershell scripts
- Install a fresh vCSA with the same name and IP of your old vCSA (which is now shutdown).
- Add the new vCSA to AD and configure Identity Source
Restore vPostgres Database:
- Transfer the file restore_lin.py and VCDB.bak to /tmp on the vCSA via WinSCP or e.g. (How to enable BASH on vCSA to transfer files via SCP or e.g.)
- Login to vCSA as root
- Make the py script executable chmod 700 /tmp/restore_lin.py
- stop the services vpxd and vdcs
- Execute the script python /tmp/restore_lin.py -f /tmp/VCDB.bak
- After successfully restore start the services vpxd and vdcs
Login Web Client with email@example.com
- Reconnect your ESXi hosts.
- Add missing licenses
Import roles and permissions:
- Execute the vsphere_RightsRoles_Import.ps1 script and fill in your data
- The script uses the vcenter-permissions.xml file on c:\
After that you should be able to connect with AD users with the old rights.