If you backed up the embedded PostgreSQL database of a vCloud Director appliance environment with an HA database configuration, you can deploy a new appliance cluster and restore the appliance database in it.

The restore workflow includes three major stages.

  • Copying the embedded database backup .tar file from the transfer service NFS shared storage.
  • Restoring the database to the embedded database primary and standby cells.
  • Deploying any required application cells.

Prerequisites

Procedure

  1. On the primary and standby cells, log in as root, and run the command to stop the vCloud Director service.
    service vmware-vcd stop
  2. On the primary and standby cells, copy the backup .tar file to the /tmp folder.

    If there is not enough free space on the /tmp folder, use another location to store the .tar file.

  3. On the primary and standby cells, untar the backup file at /tmp.
    tar -zxvf db-backup-date_time_format.tgz

    In the /tmp folder, you can see the extracted global.properties, responses.properties, certificates, proxycertficates, truststore, and the database dump file named vcloud_date_time_format.

    Note: The truststore file is only available for vCloud Director 9.7.0.1 and later.
  4. On the primary cell only, log in as root to the console and run the following commands.
    1. Drop the vcloud database.
      sudo -i -u postgres /opt/vmware/vpostgres/current/bin/psql -c 'DROP DATABASE vcloud;'
    2. Run the pg_restore command.
      sudo -i -u postgres /opt/vmware/vpostgres/current/bin/pg_restore -C -d postgres /tmp/vcloud_date_time_name
  5. On the primary and standby cells, save a copy of the configuration data files, replace them, and reconfigure and start the vCloud Director service.
    1. Back up the properties, certificates, and truststore files.
      The global.properties, responses.properties, certificates, proxycertificates, and truststore files are at /opt/vmware/vcloud-director/etc/.
      Note: The truststore file is only available for vCloud Director 9.7.0.1 and later.
      cd /opt/vmware/vcloud-director/etc
      mkdir -p backup
      cp global.properties responses.properties certificates proxycertificates truststore backup
    2. Copy and replace the properties, certificates, and truststore files from the backup files that you extracted at Step 3.
      cd /tmp
      cp global.properties responses.properties certificates proxycertificates truststore /opt/vmware/vcloud-director/etc/.
      Note: The truststore file is only available for vCloud Director 9.7.0.1 and later.
      cp certificates /opt/vmware/vcloud-director/.
    3. Back up the keystore file that is at /opt/vmware/vcloud-director/certificates.ks.
      cd /opt/vmware/vcloud-director
      mkdir -p backup
      cp certificates.ks backup
    4. Run the command to reconfigure the vCloud Director service.
      /opt/vmware/vcloud-director/bin/configure --unattended-installation --database-type postgres --database-user vcloud \
      --database-password db_password_new_primary --database-host eth1_ip_new_primary --database-port 5432 \
      --database-name vcloud --database-ssl true --uuid --keystore /opt/vmware/vcloud-director/certificates.ks \
      --keystore-password ks_password --primary-ip appliance_eth0_ip \
      --console-proxy-ip appliance_eth0_ip --console-proxy-port-https 8443 
      Where:
      • The --keystore-password option matches the keystore password for the certificates on the appliance.
      • The --database-password option matches the database password that you set during the appliance deployment.
      • The --database-host option matches the eth1 network IP address of the primary database appliance.
      • The --primary-ip value matches the eth0 network IP address of the appliance cell that you are restoring. This is not the primary database cell IP address.
      • The --console-proxy-ip option matches the eth0 network IP address of the appliance that you are restoring.

      For troubleshooting information, see Reconfiguring the vCloud Director Service Fails When Migrating or Restoring to vCloud Director Appliance.

    5. Run the command to start the vCloud Director service.
      service vmware-vcd start

      You can monitor the progress of the cell startup at /opt/vmware/vcloud-director/logs/cell.log.

  6. (Optional) Deploy any additional application cells. See Deploying the vCloud Director Appliance.
  7. After all cells of the server group finish the startup process, verify that the restore of your vCloud Director environment is successful.
    1. Open the vCloud Director Service Provider Admin Portal by using the eth0 network IP address of any cell from the new server group, https://et0_IP_new_cell/provider.
    2. Log in to the Service Provider Admin Portal with your existing system administrator credentials.
    3. Validate that your vSphere and cloud resources are available in the new environment.
  8. After the successful verification of the database restore, use the Service Provider Admin Portal to delete the disconnected cells that belong to the old vCloud Director environment.
    1. From the main menu (), select Cloud Resources.
    2. In the left panel, click Cloud Cells.
    3. Select an inactive cell and click Unregister.