Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to back up and restore vCenter Server Appliance vPostgres databases

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to back up and restore vCenter Server Appliance vPostgres database, in view of this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Purpose

Here are the steps for backing up and restoring the vCenter Server Appliance (VCSA) vPostgres database.

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

Note: this article only supports backing up and restoring vPostgres databases to the same vCenter Server Appliance. Using image-based backup and restore is the only solution supported to perform a complete secondary device restore.

Resolution

Before continuing, make sure that you have installed:

The SSH client used to connect to the vCenter Server Appliance.

WinSCP (or any SCP client) used to retrieve and replace vPostgres database recovery files.

Backing up embedded vPostgres database

To back up an embedded vPostgres database:

Connect to vCenter Server Appliance through SSH. For more information, see the section "enabling or disabling SSH administrator login on VMware vCenter Server Appliance" in vCenter Server and Host Management Guide.

When prompted, log in as root. The default password is vmware.

Stop the VMware vCenter Server service by running the following command:

Service vmware-vpxd stop

On the vCenter Server Appliance virtual machine, use the following command to navigate to the vPostgres utility directory:

Cd / opt/vmware/vpostgres/current/bin

To display the vPostgres database configuration file, run the following command:

Cat / etc/vmware-vpx/embedded_db.cfg

To back up the vCenter Server database, run the following command:

. / pg_dump EMB_DB_INSTANCE-U EMB_DB_USER-Fp-c > VCDBBackupFile

Fill in the EMD_DB_INSTANCE and EMB_DB_USER with the embedded_db.cfg configuration information listed in step 5. Fill in the VCDBBackupFile with the location and file name to be generated, for example:

. / pg_dump VCDB-U vc-Fp-c > / tmp/VCDBackUp

Note: if prompted, enter the EMB_DB_PASSWORD password.

Warning:

After rebooting vCenter Server Appliance, the / tmp/ directory will be reset. If this location is already in use, VMware recommends that you move the backup to a persistent location.

The storage space of the / tmp/ directory is 6GB, and if the database is larger than this size, you need to use a different location.

Connect to vCenter Server Appliance using WinSCP, and then download the VCDBackUp file: / tmp/ from here

Start the VMware vCenter Server service by running the following command:

Service vmware-vpxd start

Restore from a backend vPostgres database file

To restore from a backup vPostgres database file:

Note: be sure to take a snapshot of the vCenter Server Appliance virtual machine before continuing. If the restore process fails, you can restore the database from the snapshot.

Connect to vCenter Server Appliance through SSH. For more information, see the section "enabling or disabling SSH administrator login on VMware vCenter Server Appliance" in vCenter Server and Host Management Guide.

Connect to vCenter Server Appliance using WinSCP, and then upload a backup copy of the VCDBackUp file to the / tmp/ directory

To display the new vPostgres database configuration file, run the following command:

Cat / etc/vmware-vpx/embedded_db.cfg

Navigate to the vPostgres utility directory by running the following command:

Cd / opt/vmware/vpostgres/current/bin

Stop the VMware vCenter Server service by running the following command:

Service vmware-vpxd stop

To restore the vCenter Server vPostgres database from a backup, run the following command:

PGPASSWORD='EMB_DB_PASSWORD'. / psql-d EMB_DB_INSTANCE-Upostgres-f VCDBBackupFile

Fill in the EMD_DB_INSTANCE and EMB_DB_PASSWORD with the embedded_db.cfg configuration information listed in step 3. Fill in the location and file name you want to use in VCDBBackupFile, for example:

PGPASSWORD='g

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report