How to Backup vCenter Database | vPostgres and MS SQL

vCenter Server database is a important component of a vCenter Server instance. Before updating vCenter or deleting outdated data, you may want to backup vCenter database just in case. This article will show you how to backup vCenter embedded vPostgres and external MS SQL databases.

Crystal

By Crystal / Updated on December 28, 2022

Share this: instagram reddit

vCenter Server database overview

As the number of created virtual machines increases, your enterprise is likely to use VMware vCenter Server, the centralized management utility provided by the vSphere suite for managing multiple ESXi hosts, VMs, and other components.

vCenter Server requires a database to store and organize server data.

vmware vcenter server

Database types supported by vCenter Server

For vCenter Server on Windows, you can either use the bundled PostgreSQL database that can be installed and configured together with vCenter Server, or you can set up an external database prior to installing vCenter Server. vCenter Server for Windows supports Oracle and Microsoft SQL Server as external databases.

Work properly with vCenter Server database

In vCenter, dozens of tables store information on resources, clusters, VMware Distributed Resource Scheduler, snapshots, VMware ESX hosts, virtual machines, alarms, performance statistics, tasks and events, and more. As the number of the hosts and VMs managed in your environment grows, the database can grow very large.

So, you may need to monitor the size of your vCenter Server database and regularly delete outdated data to save storage space, improve system performance, and reduce the chance of database corruption.

However, deleted data will be difficult to retrieve. To avoid accidental loss of important data, it is recommended that you back up vCenter database before performing a bulk delete or updating your vCenter Server.

Next, this article will show you the steps of how to backup vCenter database.

How to backup vCenter database step by step

As you know, vCenter supports embedded vPostgres and external MS SQL or Oracle databases. And the ways to backup these 2 types of databases are different. Next, this part will show you the steps of how to backup vCenter database of these 2 types.

How to backup embedded PostgreSQL vCenter Server database

1. Log-in as an administrator to the Windows host machine on which vCenter Server is installed, navigate to C:\ProgramData\VMware\vCenter Server\cfg\vmware-vpx\ folder and then open the vcdb.properties file in a text editor.

Open vcdb.properties file

2. In the vcdb.properties file, record the password for the vCenter Server database user.

Record vCenter database password

3. Download the official package windows_backup_restore.zip attached to VMware’s KB article and extract is on the vCenter Server.

Download Windows backup vCenter database package

4. Open a Command Prompt and navigate to the following location:

%VMWARE_CFG_DIR%\python

5. Run the following command using the vCenter password you recorded to start backup:

python.exe c:\path_to_script\backup_win.py -p "password" -f c:\path_to_backup_folder\backup_VCDB.bak

For example:

python.exe c:\backup_win.py -p "s_PJmbGzC83QRYlp" -f c:\backup_VCDB.bak

vCenter database backup command

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

How to backup external MS SQL vCenter Server database

1. Open Microsoft SQL Server Management Studio Express and connect to the vCenter Server database server or instance.

Connect to vCenter instance

Note: If you are not using a dedicated SQL server, the database resides on vCenter Server. To verify the location and database name:
1. Open the ODBC connector.
2. Click the System DSN tab.
3. Find the vCenter Server item.
4. Click configure.
5. Proceed through the steps and note the SQL Server and the default database.

ODBC vCenter

2. Stop all vCenter Server services on the vCenter Server system, to ensure that no service is out of sync during the backup.

3. Expand Databases and look for the vCenter Server database, the default name is VIM_VCDB.

VIM_VCDB

4. Right-click the vCenter Server database and then click Tasks > Back Up.

backup vCenter database

5. Select your backup options and Click OK.

Configure database backup options

Remember to copy the backup file to a safe location during maintenance or upgrades, and ensure to perform this backup before performing any operation on vCenter Server, as it holds current and historical data.

Necessary data protection: Batch backup VMs managed by vCenter

vCenter Server is a very convenient official platform for centrally managing ESXi virtual environments and large numbers of VMs on it. A single vCenter Server instance can support a maximum of 1,000 hosts, 10,000 powered-on virtual machines and 15,000 registered virtual machines.

However, vCenter Server does not provide the feature of virtual machine backup. And that makes backup software a commonly accepted choice. Here I introduce you to a VMware backup software AOMEI Cyber Backup, it enables you to backup multiple VMs either managed by vCenter Server, or on a standalone ESXi host.

Agentless Backup: create complete and independent image-level backup for VMware ESXi and Hyper-V VMs.
Multiple VM Backup: batch backup large numbers of VMs managed by vCenter Server, or multiple VMs on a standalone ESXi host.
Multiple Storage Destinations: backup to a local drive, or network destinations like NAS.
Automated Execution: create backup schedules to automate backups daily, weekly, or monthly.
Restore Entire VM: restore instant available VMs from any selected restore points to an original or new location.

AOMEI Cyber Backup

AOMEI Cyber Backup supports VMware ESXi 6.0 and later versions. Next, I will show you how to batch backup VMs managed by vCenter Server with AOMEI Cyber Backup in 4 simple steps. You can click the following button to download the 30-day free trial.

Download Free TrialVMware ESXi & Hyper-V
Secure Download

*You can choose to install this VM backup software on either Windows or Linux system.

4 Steps to batch backup VMs managed by vCenter Server

1. Bind Devices: Access to AOMEI Cyber Backup web client, navigate to Source Device > VMware > + Add VMware Device to Add vCenter or Standalone ESXi host. And then click > Bind Device.

Add VMware ESXi host

2. Create Backup Task: Navigate to Backup Task > + Create New Task, and select VMware ESXi Backup as the Backup Type.

VMware ESXi backup

3. Set Task Name, Device, Target, Schedule, and Cleanup as needed.

  • Task Name: you can change the task name or use the default name with an ordinal.
  • Device: batch select large numbers of VMs managed by vCenter Server for centralized backup.

Select virtual machines vCenter

  • Target: select to back up to a local path, or to a network path.
  • Schedule (optional): perform full, differential, or incremental backup, and automate execution according to the frequency you specified.

Backup schedule type

  • Cleanup (optional): automatically delete the old backup copies that exceed the retention period you specified.

backup cleanup

4. Run Backup: Click Start Backup and select Add the schedule and start backup now, or Add the schedule only.

Start Backup

Created backup tasks will be listed and monitored separately, for restoring, progress checking and schedule changing.

When restoring, you can also restore to new location to create a new VM in the same or another datastore/host directly from the backup, saving the trouble of re-configuring the new VM.

Restore to new location

Summary

Each vCenter Server instance requires a database to store the performance data, logs of tasks that were performed, and logs of events that occurred. Before you want to update vCenter or cleanup outdated data, you may want to perform vCenter database backup in advance.

vCenter Server support both embedded and external databases. This article showed the steps on how to backup vCenter databases accordingly. You can read the interested part depending on your situation.

Crystal
Crystal · Editor
Crystal is an editor from AOMEI Technology. She mainly writes articles about virtual machine. She is a positive young lady likes to share articles with peolpe. Off work she loves travelling and cooking which is wonderful for life.