Export Script¶
The export script exports the metadata of a Virtual DataPort Server. The features of this script are equivalent to the “Export” and “Export database” dialogs of the Administration Tool (see section Exporting and Importing the Server Metadata).
The metadata can be exported to:
A file that contains all the VQL statements to recreate the exported elements (option
--file
)Two files (option
--property includeProperties
):A file that contains the VQL statements of all the elements of the database. The values of the parameters that depend on the environment are variables instead of the actual values.
And, a properties file that contains the values of the variables. See more about this in the section Export to a File with Properties.
Or, a Repository: the metadata is stored in a set of files, where each file contains the VQL statement to create an element (option
--repository
).After the exporting process, there will be a folder for each virtual database of the Server. In each of these folders, there will be a folder for each type of element: folders, data sources, views, etc. And in them, a file for each element, which will contain the VQL statement to create that element. This is useful if you want to use a revision control system such as Version Control System (VCS) to keep track of the changes in the metadata and the configuration of a Server.
Note
If you want to store the metadata of the Server in a VCS, we recommend using the VCS integration of Virtual DataPort (see section Version Control Systems Integration). However, you may need to export to repository if your VCS is not supported.
This script is located in the directory <DENODO_HOME>/bin
and its
syntax is the following:
export --login <login> [ --password <password> ]
[ --configurationfile <filename> ]
--server [//]<host>:[<port>][/<database name>] [ --nobom ]
[ --metadatapassword <password> ]
{ --file <filename>
| --repository <path to repository>
[ { --element <path to element>
| --repository-element <identifier path> }
]*
}
[ --singleuser ] [ -P <property name>=<property value> ]*
[ --view <views> ]
export --revision -l <login> [ -p <password> ]
[ -cf <configurationFile> ] h <URI> -f <outputFilename>
-fc <from_commit> [ -tc <to_commit> ]
[ -P includePrivileges=yes|no ]
[ -P includeServerConfiguration=yes|no ]
Parameter Name |
Description |
---|---|
-l --login <login> |
Login name used to connect to the Server.
|
-p --password <password> |
Password used to connect to the Server. Use the script E.g. If you do not provide the parameter |
-cf --configurationfile <filename> |
File with one line that contains this:
or this:
Use the script Incompatible with -p. |
-h --server <URI of the Server> |
URI of the Server (<host>:[<port>][/<database name>]) If |
-f --file <filename> |
Name of the target file where the VQL statements will be stored. This option is not
compatible with the
option |
-z --zip |
If present, the script compresses the result on a zip file. |
-nb --nobom |
If you add this parameter, the script generates the output files without the “Byte order mark” (BOM). By default, the script adds the BOM mark to the output files to indicate that they are encoded in UTF-8. Thanks to this mark, the applications that have to read these files can quickly detect their encoding without having to guess it. However, there are applications that cannot handle the BOM. In that case, add this parameter. |
-mp --metadatapassword <password> |
Encrypt the sensitive values using the given password (e.g. passwords of data sources). You can indicate the password encrypted to avoid
entering it in plain text. To do this, use the script
E.g. |
-r --repository <path to repository> |
Path to the directory where the Repository will be created or where it already exists. This option is not
compatible with the
option |
-revision |
If VCS configured, generate the VQL from the difference of 2 commits or 2 tags |
-e --element |
The relative path of a single element in a repository, relative to its future position in the repository. E.g.
|
-re --repository-element |
The identifier path of an element. The syntax of this
identifier is:
E.g. admin:view:/incidents The values of The value of
|
-su --singleuser |
Only valid when
exporting to a file
( If present, the file
generated will begin
with the statement
so that Virtual DataPort switches to single user mode while importing this file. This option is ignored when exporting to a Repository. Note: you are strongly advised to import metadata into a Virtual DataPort server in single user mode. |
-P --property |
Set of settings that control the export process. You can specify one or more properties with this syntax:
Properties than can be passed to the export script (–property parameter) lists the available properties. |
-v --view <views> |
List of comma-separated view names to include in the export. Only valid when
exporting to a file
( The E.g.
If E.g.
|
|
Only applicable for -revision Specifies the starting commit hash to begin searching for differences (mandatory) |
|
Only applicable for -revision Specifies the ending commit hash for the difference comparison (optional, default: HEAD) |
The properties that control the export process (-P
, --property
)
are the following:
Possible Arguments for --property |
Description |
---|---|
cluster |
Default value: If
Note: this parameter is deprecated. The section Features Deprecated in Denodo Platform lists all the features that are deprecated. When working in an environment with
a cluster of Virtual DataPort
servers. The main Server must have
different settings from the rest.
E.g., the “Cache maintenance task”
only can be active in one of the
Servers. In this scenario, we
recommend adding the parameter
Adding the parameter -P includeJMSListeners=no
-P includeDatabaseCacheMaintenanceProperties=no
-P excludeServerConfigurationProperties=
com.denodo.vdb.vdbinterface.server.VDBManagerImpl.registryURL,
com.denodo.vdb.vdbinterface.server.VDBManagerImpl.registryPort,
com.denodo.vdb.vdbinterface.server.VDBManagerImpl.shutdownPort,
com.denodo.vdb.vdbinterface.server.VDBManagerImpl.factoryPort,
com.denodo.vdb.vdbinterface.server.VDBManagerImpl.odbcPort,
com.denodo.vdb.cache.cacheMaintenance,
java.env.DENODO_OPTS_START,
java.env.DENODO_OPTS_STOP
-P excludeWebContainerConfigurationProperties=com.denodo.tomcat.http.port,
com.denodo.tomcat.shutdown.port,
com.denodo.tomcat.jmx.rmi.port,
com.denodo.tomcat.jmx.port,
java.env.DENODO_OPTS_START,
java.env.DENODO_OPTS_STOP
|
exclude_jdbc_wrapper_properties |
When you add Default value: |
excludeServerConfigurationProperties |
When exporting the entire Virtual DataPort server, the output includes all the settings of the Server: cache module, concurrent requests, default i18n, etc. This property is a comma-separated list of these properties whose value will not be exported. Make sure you do not put the space character between the comma and the name of each property. Default value: empty list. Valid values:
|
excludeWebContainerConfigurationProperties |
When exporting the entire Virtual DataPort server, the output includes all the settings of the embedded Web container. This property is a comma-separated list of these properties, whose value will not be exported. Default value: empty list. Valid values:
|
includeEnvSpecificElements |
If The section Exporting Environment-Dependent and Independent Elements to Different Files lists which elements are considered dependent on the environment. Note: this parameter is deprecated. Instead, use
|
includeNonEnvSpecificElements |
If The section Exporting Environment-Dependent and Independent Elements to Different Files lists which elements are considered independent from the environment. Note: this parameter is deprecated. Instead, use
|
replaceExistingElements |
If CREATE OR REPLACE VIEW p_customer AS SELECT … |
dropElements |
If
|
includeContents |
If If no, the output will only contain the VQL statement to create the folder. Default value: |
includeCreateDatabase |
Only valid when exporting an entire database. If
If you export all the metadata of a Server, the output already includes the statements to create the databases. |
includeDatabaseCacheMaintenanceProperties |
When exporting the metadata of the Server or a single database, the output includes the settings of the “Cache maintenance task”. If Default value: |
includeDependencies |
If For example, if you export a base
view and set this option to Only useful when you are not exporting the metadata of an entire database or Server. |
includeDeployments |
If Default value: |
includeJars |
If If you are not exporting the metadata of the entire Server, the output will only include the Jars used by the elements you are exporting. Default value: |
includeJMSListeners |
If Default value: |
includeProperties |
Generates two files: one that contains the metadata and another one that contains the values of the parameters whose value depend on the environment where the Server is running. This option cannot be used when
exporting to a repository
( |
includeResources |
If Default value: |
includeStatistics |
By default, the statistics of views are only exported when
you export the entire server, not when you export a
database nor when you export a view. To include the
statistics of the views in the result, add the option
Default value: |
includeUserPrivileges |
If yes, the output will include the statements to replicate the privileges of the exported elements. That is, it will include the statements to do the following:
Default value: |
includeVCSConfiguration |
When you export a database with the option
Default value: |
includeTagDependencies |
If yes, the output will include the tags from elements using them when an export from certain databases is executed. Default value: |
This script returns one of these exit codes:
0: no errors. The metadata was exported successfully.
126: one of the elements could not be exported.
1: for other errors. E.g. the script could not open a connection to the Virtual DataPort Server.
Examples
Example 1:
export --server "//localhost:9999/database1"
--login admin
--password encrypted:iGTAJvv6CjEd1EvBVZyO4SSkgYCE7Z2C5PMZBLRUYk2YgeibnNZmk4HyTDcecoZuounNgjKxbsh1GO5bXjpRlRIkHOUaaVMj4INs7G3bLa3AE/1MGgSfiv3V4oC/1RVf
--singleuser
--zip
--file denodo_virtual_dataport_metadata.zip
--property includejars=yes
--property includeProperties=yes
In this example, we export the metadata of the database1
of the
Server running in localhost
, port 9999
, using the credentials
admin
/admin
. The encrypted password has been obtained with the
script encrypt_password
.
The resulting VQL file and the properties file are stored and compressed in the file denodo_virtual_dataport_metadata.zip
.
Example 2:
export --server "//localhost:9999"
--login admin
--password admin
--singleuser
--repository "C:/repository"
--property includejars=yes
In this example, we export to a Repository the metadata of all the
databases and the settings of the Server. The Repository will be created
in the directory C:\repository
Example 3:
export --server "//localhost:9999"
--login admin
--password encrypted:iGTAJvv6CjEd1EvBVZyO4SSkgYCE7Z2C5PMZBLRUYk2YgeibnNZmk4HyTDcecoZuounNgjKxbsh1GO5bXjpRlRIkHOUaaVMj4INs7G3bLa3AE/1MGgSfiv3V4oC/1RVf
--singleuser
--repository "C:/repository"
--repository-element
"vdp_testing:datasource:jdbc:/Data sources/internet_ds"
In this example, we export to a Repository the metadata of the data
source JDBC named internet_ds
of the database vdp_testing
.
Example 4:
export --revision -l admin -p admin -h localhost:9999/admin -f
revision.output -fc ab12cd34 -tc HEAD -P includePrivileges=yes -P includeServerConfiguration=yes
In this example, we export the VQL revision from commit ab12cd34 to HEAD to file ‘revision.output’ using the specified connection parameters.