Back up the embedded vCenter Server Appliance database to protect the data stored in your vPostgres database.

Prerequisite:

Create the folder in which you want to create the backup file and verify that you have read and write permissions on this folder.

Procedure:

Caution: This procedure cannot be stopped. Stopping the script will cause inconsistencies in the vCenter Server appliance database and can prevent vCenter Server appliance from starting.

  1. Log in to the vCenter Server Appliance Linux console as root.
  2. Download the Linux backup and restore package 2091961_linux_backup_restore.zip attached to this Knowledge Base article and extract it on the Linux machine.
  3. Make a backup_lin.py executable.

    For example to save the file as /tmp/backup_lin.py , run this command:

    chmod 700 /tmp/backup_lin.py

  4. Run the backup_lin.py file and provide the location for the backup file.

    For example, if you want to save the file as /tmp/backup_VCDB.bak, run this command:

    python /tmp/backup_lin.py -f /tmp/backup_VCDB.bak

When the backup completes, you see a message that the backup completed successfully.

 

Restore the vCenter Server Appliance vPostgres Database

It may be required to copy the database to the new vCenter Server Appliance or Windows installed vCenter Server. After you back up the embedded vPostgres database, you can restore it from the backup file.

Note: Using WinSCP on the vCenter Server Appliance may fail. For more information, see Error when uploading files to vCenter Server Appliance using WinSCP (2107727).

Prerequisite:

Back up the vCenter Server Appliance embedded vPostgres database.

Procedure:

Caution: This procedure cannot be stopped. Stopping the script will cause inconsistencies in the vCenter Server appliance database and can prevent vCenter Server appliance from starting.

  1. Log in to the vCenter Server Appliance Linux console as root.
  2. Download the Linux backup and restore package 2091961_linux_backup_restore.zip attached to this Knowledge Base article and extract it on the Linux machine.
  3. Make a restore_lin.py executable, for example /tmp/restore_lin.pychmod 700 /tmp/restore_lin.py
  4. Stop the vmware-vpxd and vmware-vdcs services, by running these commands depending on vCenter Server version:
For 6.7:
service-control –stop vmware-vpxd
service-control –stop vmware-content-library
For 6.5:
service-control –stop vmware-vpxd
service-control –stop vmware-content-library

For 6.0:
service-control –stop vmware-vpxd
service-control –stop vmware-vdcs

 

  1. Run the restore_lin.py file and provide the location for the backup file.

    For example, if the backup file is saved to /tmp/backup_VCDB.bak, run this command:

    python /tmp/restore_lin.py -f /tmp/backup_VCDB.bak

    When the restore completes, you see a message that the restore completed successfully.

  2. Start the vmware-vpxd and vmware-vdcs services, by running these commands depending on vCenter Server version:
For 6.7:
service-control –start vmware-vpxd
service-control –start vmware-content-library

For 6.5:
service-control –start vmware-vpxd
service-control –start vmware-content-library

For 6.0:
service-control –start vmware-vpxd
service-control –start vmware-vdcs