Use the dbextract command of the cell management tool to export data from the vCloud Director database.

To export database tables, use a command line with the following form:

cell-management-tool dbextract options

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

Option

Argument

Description

--help (-h)

None

Provides a summary of available commands in this category.

-categories

A comma-separated list of table categories to export.

Optional. NETWORKING is the only supported category

-dataFile

An absolute path to a file describing the data to export.

Optional. If not supplied, the command uses $VCLOUD_HOME/etc/data_to_export.properties. See Specifying Tables and Columns to Export.

-dumpFolder

An absolute path to the folder in which to create the dump. The folder must exist and be writable by vcloud.vcloud.

All data will be exported to a file in this folder.

-exportSettingsFile

An absolute path to a data export settings properties file.

Optional. If not supplied, the command uses$VCLOUD_HOME/etc/data_export_settings.ini. See Limiting and Ordering Exported Rows.

-properties

An absolute path to a database connection properties file.

Optional. If not supplied, the command uses the database connection properties in $VCLOUD_HOME/etc/global.properties. See Specifying a Properties File.

-tables

A comma-separated list of tables.

Optional. Export all tables to see individual table names.

Specifying a Properties File

By default, the dbextract command extracts data from the vCloud Director database using the database connection information in the current cell's $VCLOUD_HOME/etc/global.properties file. To extract data from a different vCloud Director database, specify the database connection properties in a file and use the -properties option to provide the pathname to that file on the command line. The properties file is a UTF-8 file that has the following format.

username=username
password=password
servicename=db_service_name
port=db_connection_port
database-ip=db_server_ip_address
db-type=db_type

username

The vCloud Director database user name.

password

The vCloud Director database password.

db_service_name

The database service name. For example, orcl.example.com .

db_connection_port

The database port.

db_server_ip_address

The IP address of the database server.

db_type

The database type. Must be Oracle or MS_SQL.

Specifying Tables and Columns to Export

To restrict the set of data exported, use the -exportSettingsFile option and create a data_to_export.properties file that specifies individual tables and, optionally, columns to export. This file is a UTF-8 file that contains zero or more lines of the form TABLE_NAME:COLUMN_NAME.

TABLE_NAME

The name of a table in the database. To see a list of table names, export all tables.

COLUMN_NAME

The name of a column in the specified TABLE_NAME.

This example data_to_export.properties file exports columns from the ACL and ADDRESS_TRANSLATION tables.

ACL:ORG_MEMBER_ID
ACL:SHARABLE_ID
ACL:SHARABLE_TYPE
ACL:SHARING_ROLE_ID
ADDRESS_TRANSLATION:EXTERNAL_ADDRESS
ADDRESS_TRANSLATION:EXTERNAL_PORTS
ADDRESS_TRANSLATION:ID
ADDRESS_TRANSLATION:INTERNAL_PORTS
ADDRESS_TRANSLATION:NIC_ID

The command expects to find this file in $VCLOUD_HOME/etc/data_to_export.properties, but you can specify another path.

Limiting and Ordering Exported Rows

For any table, you can specify how many rows to export and how to order the exported rows. Use the -exportSettingsFile option and create a data_export_settings.ini file that specifies individual tables. This file is a UTF-8 file that contains zero or more entries of the following form:

[TABLE_NAME]
rowlimit=int
orderby=COLUMN_NAME

TABLE_NAME

The name of a table in the database. To see a list of table names, export all tables.

COLUMN_NAME

The name of a column in the specified TABLE_NAME.

This example data_export_settings.ini restricts data exported from the AUDIT_EVENT table to the first 10000 rows and orders the rows by the value in the event_time column

[AUDIT_EVENT]
rowlimit=100000
orderby=event_time

The command expects to find this file in $VCLOUD_HOME/etc/data_export_settings.ini, but you can specify another path.

Exporting All Tables From the Current vCloud Director Database.

This example exports all tables of the current vCloud Director database to the file /tmp/dbdump .

[root@cell1 /opt/vmware/vcloud-director/bin]# ./cell-management-tool dbextract -dumpFolder /tmp/dbdump
This utility outputs data from your vCloud Director system
that may contain sensitive data.
Do you want to continue and output the data (y/n)?
y
Exporting data now. Please wait for the process to finish
Exported 144 of 145 tables.