To migrate the vCenter Server database from an SQL Express instance to full SQL Server:
Note: Ensure that you are using the dbo schema and not custom schemas in your vCenter Server database.
- Stop the VirtualCenter Server service.
- Take a complete backup of the vCenter Server database. Do not skip this step.
- Stop the vCenter Server database on the SQL Express server.
- Copy the backed up database to the full SQL Server host.
- Create a new database on the full SQL Server.
- Restore the backed up SQL Express vCenter Server database to the newly created database. To ensure a proper restore, navigate to Options and click Overwrite existing database with replace.
Notes:
- The instructions above also apply when full SQL Server is installed locally on the vCenter Server Windows host. SQL Express 2005 is upgraded to SQL Server 2008 after you have created the new 2008 database and restored the SQL Express 2005 database to the SQL 2008 Server.
- If the new instance of full SQL Server is installed locally for the database migration, the vCenter Service's SQL Server Instance dependency may need to be recreated or modified.
- You must remove and recreate the system DSN so that it uses the SQL Native Client 10.0/11.0 driver. Download the x86 for vCenter Server 4.0 and earlier, and x64 for vCenter Server 4.1 and later.
Note: The preceding links were correct as of October 24, 2014. If you find a link is broken, provide a feedback and a VMware employee will update the link.
- Ensure the DSN connects to the newly created database on SQL 2008 Server. For vCenter Server 4.1 and later, ensure a 64-bit DSN is created for the ODBC connection.
- For vCenter Server 5.1, the Single Sign-On (SSO) database may also have to be migrated.
- Configure the vCenter Server account that connects to the database as the
dbo
user of the MSDB system database. - Update the ODBC connection on vCenter Server.
Note: This procedure modifies the Windows registry. Before making any registry modifications, ensure that you have a current and valid backup of the registry and the virtual machine. For more information on backing up and restoring the registry, see Microsoft Knowledge Base article 136393.
To update the ODBC connection settings for vCenter Server 4.x/5.x:
- Click Start > Run, type
regedit
, and click OK. The Registry Editor window opens. - Navigate to HKEY_LOCAL_MACHINE > SOFTWARE > VMware, Inc > VMware VirtualCenter.
- Modify the key
DbInstanceName
and remove the current Value data. Do not delete this key. - Modify the key
DbServerType
and change the Value data from Bundled
to Custom
. - Navigate to HKEY_LOCAL_MACHINE > SOFTWARE > VMware, Inc > VMware VirtualCenter > DB.
- If the ODBC connection name is changed, modify Key 1 with the name of the new ODBC connection.
- Modify Key 4 and change the ODBC driver to the new driver.
- Modify key 2 and add the vCenter Server user, for example
sa
.
To update the ODBC connection settings for vCenter Server 6.x:
- Navigate to: C:\ProgramData\VMware\vCenterServer\cfg\vmware-vpx. (Default Path)
- Take a backup copy of vpxd.cfg
- Open the vpxd.cfg file in a text editor.
- Locate the <DB> element and modify the value for <key_2> to reflect the new database user ID.
...
<DB>
<key_2>database_user_id</key2>
<key_3>*joqDY/eQvwyLBdLcXXJYZvDAd+FXYY8q7x///vhy4LE=</key_3>
</DB>
...
Note:-If you are using Windows Integrated Authentication to connect to the vCenter Server database, remove the value for <key_3>.
- Save the vpxd.cfg file.
- To change the database password stored in the registry(vpxd.cfg file in case of vCenter Server 6.x) and to allow the user to update the ODBC information without reinstalling vCenter Server.
- Click Start > Run
- Type cmd
- Right-click on the Command prompt icon and select Run as Administrator.
- Run this command:
C:\Program Files\VMware\Infrastructure\VirtualCenter Server\vpxd.exe -p
Note: This is the default path to the vCenter Server installation directory. Change the path appropriately, if required.
- Recreate the rollup jobs. For more information : Verifying jobs and stored procedures installed in vCenter Server 5.1, 5.5 and 6.x
- Ensure that the
vcdb.properties
file found in below location reflects the new SQL database information, otherwise, change the URL manually to the new SQL Server address:
vCenter Server 5.x/4.x: C:\ProgramData\VMware\VMware VirtualCenter
vCenter Server 6.x: C:\ProgramData\VMware\vCenterServer\cfg\vmware-vpx
Example
vcdb.properties:
usevcdb=true
url=jdbc:sqlserver://<SQL_SERVER_NAME>;databaseName\=<VCDB>username=username ------------>(SQL Authentication account )
password=password ------------>(SQL account password)
dbtype=mssql
driver=com.microsoft.sqlserver.jdbc.SQLServerDriverNote: If using vCenter Server 5.0 ensure that the database settings used by the Tomcat Server are updated.
- Start the vCenter Server services.
If vCenter Server service has dependency on SQL Express follow the steps given below:
- Open regedit and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\vpxd.
- Click the DependOnService column. The value of DependOnService lists all the services the vCenter Server depends on.
- Delete the SQL Express service line.
- Do similarly check for ControlSet001 and ControlSet002 folders.
- Reboot the vCenter Server.
- Ensure the SQL Express service was set to manual/disabled and stopped.
- Start vCenter service.
Note: If you experience issues accessing the Storage View tab after the migration, see Accessing the Storage tab view in vCenter Server 5.0 fails with an internal error: com.vmware.vim.sms.fault.serviceInitializationException (2015180).
Note:If you are experiencing Error : vcdb.error.read.data Error while reading data from the vCenter Server database: Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections.
make sure while modifying the SQL DB access we follow the permissions as mentioned in https://docs.vmware.com/en/VMware-vSphere/6.0/com.vmware.vsphere.install.doc/GUID-B7C29C3F-1D15-47E2-AA79-DC4AB3DF546E.html
And Make sure Granting additional privileges to the vCenter Server database user using KBA https://kb.vmware.com/s/article/2114754