Networknet archive Blog

VMware: Back up and migrate a small vCenter database

Originally published Last updated 3 comments

By Ivan Versluis

For a small vCenter Server deployment, the VMware installer offers a local Microsoft SQL Server 2005 Express instance to store its data. I had used that option on my vCenter virtual machine and now wanted to move the database to a central SQL Server.

VMWare vCenter Server Database Options

The steps below describe how I backed up and migrated VIM_VCDB from that local SQL instance to the central server.

Back up the local vCenter database

Open an elevated command prompt. I am working on Windows Server 2008 R2. Run:

SQL1 line
1
sqlcmd -S localhost\SQLEXP_VIM -E

This connects to the SQLEXP_VIM named instance on the local SQL Server 2005 Express installation.

SQL2 lines
1
2
 BACKUP DATABASE VIM_VCDB TO DISK = "C:\Temp\VIM.bak" WITH NOFORMAT, INIT, NAME = "VCENTER", SKIP,NOREWIND, NOUNLOAD, STATS = 10
GO

BACKUP DATABASE creates VIM.bak from the local VIM_VCDB database.

sqlcmd for vCenter database backup

I copied VIM.bak and restored it with Microsoft SQL Server Management Tools. I added the computer account to SQL Server security and assigned database ownership. Then I opened ODBC, changed the System DSN to point to the central SQL Server and restarted the VMware VirtualCenter Server service. Everything was running again.

Uninstall the local SQL Server instance through Add/Remove Programs.

3 comments

Comments from the original WordPress site, kept read-only.

    1. Ivan

      Hey Vigo,

      Good to see you here!

      While working today on the vCenter server I made some notes and published that to my site. I have used same procedure before but with a WSUS database.

      Check out this post. On the vCenter server the sqlcmd tool was installalled out of the box now.
      How to backup or export a WSUS 3.0 database?