Search the VMware Knowledge Base (KB)
View by Article ID

Uninstalling vCenter Server 6.0.x resets the embedded VMware Postgres database (2108547)

  • 5 Ratings
Language Editions

Purpose

If you use the embedded VMware Postgres database with vCenter Server 6.0 and you uninstall vCenter Server, the uninstallation process removes the embedded database. This causes loss of all the vSphere environment inventory from the current installation.

If you want to continue using vCenter Server on a SQL Server, prior to upgrading to vSphere 6.0, migrate the SQL database from the SQL Express instance running on vCenter Server to an external SQL Server instance. For more information, see the Prepare Microsoft SQL Server Database Before Upgrading vCenter Server section in the vSphere Upgrade Guide for vSphere 6.0.

Resolution

Note: Before uninstalling vCenter Server 6.0 with the embedded VMware Postgres database, ensure to take a backup of the embedded VMware Postgres database before proceeding to recreate the database after you reinstall vCenter Server.

Attached to this article is the Windows_Backup_Restore.zip to streamline the backup and restore procedure for a Windows installed vCenter Server.

If you have installed vCenter Server in the default location, use these commands. If vCenter Server is installed in a non-default location, adjust these commands accordingly.

Perform these steps on the Host Operating System (Host OS) on which you installed vCenter Server.
  1. Download and unzip one of the *_Backup_Restore.zip files attached to this article .

    Note: For this article, we are extracting to c:\backup_restore

  2. Collect a vCenter server support log bundle.
  3. Locate and open the %VMWARE_CFG_DIR%\vmware-vpx\ vcdb.properties file.
  4. Copy the Postgres vCenter user password string from the vcdb.properties  file.

    For example:

    driver = org.postgresql.Driver
    dbtype = PostgreSQL
    url = jdbc:postgresql://localhost:5432/VCDB
    username = vc
    > password = password1
    password.encrypted = false


  5. Open an elevated command prompt. For more information, see Opening a command or shell prompt (1003892).
  6. Stop the VMware VirtualCenter service by navigating to Start > Control Panel > Administrative Tools > Services.
  7. Right-click VMware VirtualCenter service and click Stop and wait for the service to stop.
  8. UseRun these commands to execute the backup script:

    cd %VMWARE_CIS_HOME%\Python\

    C:\Program Files\VMware\vCenter Server\python> python c:\backup_restore\backup_win.py -p "<Password from Step 4>" -f <backup directory>\backup_VCDB.bak

    For example:

    C:\Program Files\VMware\vCenter Server\python> python c:\backup_restore\backup_win.py -p "password1" -f c:\backup_restore\backup_VCDB.bak

    Notes:
    • Ensure that quotes are used in the -p switch
    • Ensure that the drive you are backing up to has enough space to hold the *.bak file being generated
    • If you have performed a backup previously, this operation will overwrite the previous backup. Adjust the name of the *.bak file to ensure that you do not overwrite your database backup

  9. When the backup is completed,you will see this message:

    Backup completed successfully.


  10. Uninstall vCenter Server.
  11. Reinstall vCenter Server on the same host machine.     
  12. Stop the VMware VirtualCenter service by navigating to Start Control Panel > Administrative Tools > Services. Right-click VMware VirtualCenter service and click Stop and wait for the service to stop.
  13. Locate and open the vcdb.properties  under %VMWARE_CFG_DIR%\vmware-vpx\ . This password will be regenerated and will not be the same as Step 4.
  14. Copy the Postgres VC  user's password string from the  vcdb.properties  file.

    For example:

    driver = org.postgresql.Driver
    dbtype = PostgreSQL
    url = jdbc:postgresql://localhost:5432/VCDB
    username = vc
    > password = password
    password.encrypted = false


  15. Open an elevated command prompt. For more information, see Opening a command or shell prompt (1003892).
  16. Run these commands to execute the restore script:

    cd %VMWARE_CIS_HOME%\Python\

    C:\Program Files\VMware\vCenter Server\python> python c:\backup_restore\restore_win.py -p "<Password from Step 13>" -f <backup directory>\backup_VCDB.bak

    For example:

    C:\Program Files\VMware\vCenter Server\python> python c:\backup_restore\restore_win.py -p "password " -f c:\backup_restore\backup_VCDB.bak

    Note: Ensure quotes are used in the -p  switch.

  17. When the restore is completed, you will see this message:

    Restore completed successfully.

  18. Start the VMware VirtualCenter service by navigating to Start Control Panel > Administrative Tools > Services.
  19. Right-click VMware VirtualCenter service and click Start and wait for the service to start.

Additional Information

For vCenter Server Appliance backup and restore workflows, see Back up and restore vCenter Server Appliance/vCenter Server vPostgres database (2091961).

See Also

Attachments

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback

  • 5 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.

What can we do to improve this information? (4000 or fewer characters)




Please enter the Captcha code before clicking Submit.
  • 5 Ratings
Actions
KB: