You can migrate an existing vCloud Director database from Oracle or Microsoft SQL Server to PostgreSQL by using the dbmigrate subcommand of the cell management tool.

cell-management-tool dbmigrate options

Important:

Hot migration is not supported. Before you begin a database migration, you must stop vCloud Director services. Open a console, shell, or terminal window on the cell platform and run the Linux command service vmware-vcd stop. For information about starting and stopping vCloud Director services, see vCloud Director Installation and Upgrade Guide.

Table 1. Cell Management Tool Options and Arguments, dbmigrate Subcommand

Option

Argument

Description

--help

(-h)

None

Provides a summary of available commands in this category.

--database-host

(-dbhost)

IP address or fully qualified domain name.

IP address or fully-qualified domain name of the target PostgreSQL database host.

--database-name

(-dbname)

The name of the PostgreSQL database.

The name you chose when you created the target PostgreSQL database. Typically vcloud.

--database-password

(-dbpassword)

Password for the PostgreSQL database user.

Database user password for the target PostgreSQL database.

--database-port

(-dbport)

Port number used by the PostgreSQL database service on the database host.

Port number used by the PostgreSQL database service on the database host.

--database-ssl

true or false

Configures the target PostgreSQL database to require an SSL connection from vCloud Director.

--database-user

(-dbuser)

Name of the PostgreSQL database user.

Database user name for the target PostgreSQL database.

--private-key-path

Absolute path of private key that has had its public key added to the authorized_keys of other cells in the server group.

Reconfigures all cells in the server group to use the target PostgreSQL database after migration completes.

Important:

All cells must permit SSH connections from the superuser without a password.

--verbose

None

Sends all log output to the console as well as to the log files. Includes information that reports migration status for each table and the progress of the entire operation.

If you use the --private-key-path option, all cells must be configured to permit SSH connections from the superuser without a password. To perform a verification, for example, you can run the following Linux command:

sudo -u vcloud ssh -i private-key-path root@cell-ip

This example sets your identity to vcloud, then makes an SSH connection to the cell at cell-ip as root but does not supply the root password. If the private key in private-key-path on the local cell is readable by user vcloud.vcloud and the corresponding public key is present in the authorized-keys file for the root user at cell-ip, the command succeeds.

Note:

The vcloud user, vcloud group, and vcloud.vcloud account are created by the vCloud Director installer for use as an identity with which vCloud Director processes run. The vcloud user has no password.

Migrate the vCloud Director Database to PostgreSQL and Update Database Connection Properties for All Cells

The following command migrates the current vCloud Director database to a target PostgreSQL database installed on host psql.example.com. Because the --private-key-path option is included, after the migration finishes successfully, all cells in the server group are reconfigured to connect to the target database.

[root@cell1 /opt/vmware/vcloud-director/bin]#cell-management-tool dbmigrate \
-dbhost psql.example.com -dbport 5432 -dbuser vcd-dba -dbname vcloud -dbpassword P@55w0rd \
--private-key-path /vcloud/.ssh/id_rsa
configuring the target database... 

If not including the --private-key-path option, after the migration finishes, you can connect the cells to the target database by running the reconfigure-database subcommand on each cell in the server group. See Reconfigure a Cell After Migrating the vCloud Director Database to PostgreSQL.