If you backed up the embedded PostgreSQL database of a VMware Cloud Director appliance 10.2.1 and earlier 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 VMware Cloud 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 VMware Cloud Director version 9.7.0.1 to version 10.2.1.
  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 VMware Cloud 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 VMware Cloud Director version 9.7.0.1 to version 10.2.1.
      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 VMware Cloud Director version 9.7.0.1 to version 10.2.1.
    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 following commands to reconfigure the VMware Cloud 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 --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 
      /opt/vmware/vcloud-director/bin/cell-management-tool reconfigure-database --database-ssl true
      Where:
      • The --keystore-password option matches the keystore password for the certificates on the appliance. The keystore password might be the root password you used during the appliance deployment.
      • The --database-password option matches the database password that you set during the appliance setup in the VMware Cloud Director appliance management UI at https://appliance_eth0_ip:5480.
      • 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 VMware Cloud Director Service Fails When Migrating or Restoring to VMware Cloud Director Appliance.

    5. Run the command to start the VMware Cloud 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 Deployment and Initial Configuration of the VMware Cloud Director Appliance.
  7. If the new appliances use different IPs than the original appliances that you are replacing, you must update the configuration of the load balancer which fronts the VMware Cloud Director server group to include the IPs of the new appliances.
  8. After all cells of the server group finish the startup process, verify that the restore of your VMware Cloud Director environment is successful.
    1. Open the VMware Cloud 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.

      If you updated the load balancer configuration as per step 7, you must use the public address of the server group to access the Service Provider Admin Portal.

    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.
  9. After the successful verification of the database restore, use the Service Provider Admin Portal to delete the disconnected cells that belong to the old VMware Cloud Director environment.
    1. From the top navigation bar, under Resources, select Cloud Resources.
    2. In the left panel, click Cloud Cells.
    3. Select an inactive cell and click Unregister.
  10. If the failover mode before the restore was Automatic, you must set it again to Automatic by using the VMware Cloud Director appliance API.