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

How to backup or export embedded Postgres DB from vRealize Automation appliance (2074214)

  • 2 Ratings

Purpose

This article provides steps to backup or export the embedded Postgres database from the VMware vRealize Automation (formerly known as VMware vCloud Automation Center for Server) appliance.

Resolution

To back up or export the embedded Postgres database from the VMware vRealize Automation (formerly known as VMware vCloud Automation Center for Server) appliance:

  1. Log in to the VMware vRealize Automation virtual appliance using SSH.
  2. Run this command to stop the VMware vRealize Automation service.

    service vcac-server stop

  3. Change directory using this command:

    cd /tmp

  4. Run this command to create a copy of the database in /tmp:

    Note: Both the database name and user name are vcac.
              
    su -m -c "/opt/vmware/vpostgres/current/bin/pg_dumpall -c -f /tmp/vcac.sql" postgres

  5. Run this command to compress the database:

    bzip2 -z /tmp/vcac.sql

  6. Run this command to restart the VMware vRealize Automation service:

    service vcac-server start

  7. Use SCP or WinSCP to transfer the vcacvadbdump.bz2 file out of the appliance.

Additional Information

It is recommended to use pg_dumpall as it is a complete backup. This includes multiple databases (if present) and user role information that makes it easy to re-import, if recovery is needed.

To re-import a database from backup:
  1. Log in to the VMware vRealize Automation virtual appliance using SSH.
  2. After moving the file back on to the appliance, it should be uncompressed.

    Un-compress the backup file by running this command:

    bunzip2 filename

  3. Change to the postgres user by running this command:

    su postgres

  4. Run this psql command to restore the database:

    For vRealize Automation 6.2.x and earlier versions:

    /opt/vmware/vpostgres/9.2/bin/psql \i <path to db backup file>

    For vRealize Automation 7.x:

    /opt/vmware/vpostgres/9.4/bin/ \i <path to db backup file>

Note: It is also acceptable to use normal virtual machine backup methods to back up the appliance. 
It is adequate to back up a functional database using this process due to the quiescence of the file system that occurs.

This Article Replaces

2086958

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

  • 2 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.
  • 2 Ratings
Actions
KB: