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

Migrating the VMware vCloud Director SQL database to another server (2092706)

  • 13 Ratings

Purpose

This article provides steps to migrate VMware vCloud Director (vCD) SQL database to another server.

Resolution

To migrate vCD SQL database to a different server:
  1. Log in to the vCD server and shutdown the vCD service by running this command:

    service vmware-vcd stop

  2. Log in to the vCD database as a user with sufficient privileges and detach the database by running these commands:

    USE master;
    GO
    ALTER DATABASE vCD_DB_Name
    SET SINGLE_USER
    WITH ROLLBACK IMMEDIATE;
    GO
    ALTER DATABASE vCD_DB_Name
    SET READ_ONLY;
    GO
    ALTER DATABASE vCD_DB_Name
    SET MULTI_USER;
    GO


  3. Copy the backup files to the new server.

    Note: There must be two files with the extensions .mdf and .ldf

  4. Log in to the new vCD database and attach the backup using these commands:

    USE master;
    GO
    EXEC sp_attach_db @dbname = N’
    vCD_DB_Name‘,
    c:\Program Files\Microsoft SQL Server\MSSQL\Backup\vCD_DB_Name.mdf
    c:\Program Files\Microsoft SQL Server\MSSQL\Backup\vCD_DB_Name.ldf
    GO


  5. Create a login user by running these commands:

    USE master
    GO
    exec sp_addlogin ‘UserName‘, ‘PassWord’, ‘
    vCD_DB_Name

  6. Give the new user access to the database by running these commands:

    USE [vCD_DB_Name];
    GO
    - exec sp_change_users_login ‘Report’
    EXEC sp_change_users_login ‘Update_One’, 'UserName', '
    vCD_DB_Name'
    GO


    Note: If you are on vCloud Director 8.x, instead of steps 7 and 8, you can use reconfigure-database command:

    cell-management-tool reconfigure-database options

    For more information, see the Update Database Connection Properties section in the vCloud Director Administrator Guide.

  7. Open the /opt/vmware/vcloud-director/etc/global.properties file using a text editor.
  8. Comment out or remove these lines:

    database.jbdcUrl=
    database.username=
    database.password=

  9. Log in to the vCD server and configure vCD to use the new database by running this command:

    /opt/vmware/vcloud-director/bin/configure

  10. Restart the vCD by running this command:

    service vmware-vcd start

  11. After updating the configuration, log in and verify that the vCD is working correctly.

    Note: It takes few minutes for the configuration to be updated.

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

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