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.

Prerequirements:

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.)
    restorevPostgresRolesPermissions000001
  • Login to vCSA as root
  • Make the py script executable chmod 700 /tmp/restore_lin.py
  • stop the services vpxd and vdcs
    • service vmware-vpxd stop
    • service vmware-vdcs stop
      restorevPostgresRolesPermissions000002
  • Execute the script python /tmp/restore_lin.py -f /tmp/VCDB.bak

    restorevPostgresRolesPermissions000006
  • After successfully restore start the services vpxd and vdcs
    • service vmware-vpxd start
    • service vmware-vdcs start
      restorevPostgresRolesPermissions000005

Login Web Client with administrator@vsphere.local

  • 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:\

Enable HA

After that you should be able to connect with AD users with the old rights.