USER MANUALS

Import Script

The import script imports the contents of a VQL file or a Repository into a Virtual DataPort server or into several Virtual DataPort servers at the same time.

The following sections explain how to:

This script is located in the directory <DENODO_HOME>/bin.

This script returns one of these exit codes:

  • 0: no errors. All the VQL statements in the file were executed successfully.

  • 126: the execution of one or more VQL statements failed.

  • 1: for other errors. E.g. the script could not open a connection to the Virtual DataPort Server.

Importing the Metadata from a Single File

Use the following syntax to import the metadata of a VQL file into one or more Servers:

Syntax of the import script (importing from a single VQL file)
import --file <input filename>
     [ --properties-file <properties file name>]
     {  [ --server <server URI>
       |  --servers-file <servers file>
     }
     [ --singleuser ] [ --metadata-password <password>]

<server URI> =
host:port/database?user@password[&queryTimeout=value][&chunkTimeout=value][&chunkSize=value]
Parameters of the import script when importing from a single VQL file

Parameter Name

Description

-h

--server <server URI>

URI of the Server.

You can specify the password of the Server encrypted. To do this, execute the script encrypt_password to obtain the encrypted password. Then, in the password with encrypted:

E.g. "//localhost:9999/a dmin?login@encrypted:Gr 16MjvuXhRzPtPH/yTXHw =="

If you use this script to execute queries that may take a long time, add the queryTimeout parameter to the URI to avoid reaching the query timeout. E.g.

"//localhost:9999/adm in?login@encrypted:Gr16 MjvuXhRzPtPH/yTXHw==&qu eryTimeout=11111"

If you run this script on Windows, do this:

  • Surround the value of this parameter with double quotes.

  • If the password has double quotes, escape them with another double quote. For example:

"//localhost:9999/admin?login@pas""s"

If you run this script on Linux, do this:

  • Surround the value of this parameter with single quotes.

  • If the password has single quotes, escape them. For example:

'//localhost:9999/admin?login@pas'"'"'s'

You can specify more than one --server parameter and the metadata will be imported into all of them.

-s

--servers-file <servers file>

Instead of using the parameter--server, path to a file containing URIs of Virtual DataPort Servers.

The file <servers file> must contain one or more URIs. Each URI has to be indicated in a separate line, with the same syntax of the parameter --server.

-f

--file <input file>

Path to the file that contains the metadata to be imported. This file can be a plain text file with the metadata (i.e. the VQL statements) or a zip file that contains a VQL file and a properties file.

This parameter has a different meaning if the metadata is imported from a repository instead of from a single file.

-pf

--properties-file <properties file>

Path to the properties file with the values of the parameters that depend on the environment where the Server is running.

Use this option when the metadata was exported with the option --property includeP roperties of the export script or with “Include properties file” of the Administration Tool.

-su

--singleuser

If present, the import script will execute the statement ENTER SINGLE USER MODE before executing the VQL statements of the file. At the end, the script will execute EXIT SINGLE USER MODE.

By doing this, Virtual DataPort switches to single user mode while importing the file.

Note: you are strongly advised to import metadata in a Virtual DataPort server in single user mode.

-mp

--metadata-password <password>

Decrypt the sensitive values using the given password (e.g. passwords of data sources).

This parameter is mandatory if the VQL file you are going to import was generated by:

  1. The export script, with the parameter --metadata-password

  2. Or by the administration tool, with the option Use custom password for sensitive data encryption.

Otherwise, the commands that include sensitive parameters (the ones marked with ENCRYPTED) will fail.

You can indicate the password encrypted to avoid entering it in plain text. To do this, use the script encrypt_password to obtain the encrypted password and prefix the value with encrypted.

E.g. -mp "encrypted:Gr16MjvuXhRzPtPH/yTXHw=="

Examples

Example 1:

import --singleuser --file export.vql
       --server "localhost:9999/admin?admin@admin1"
       --server "host2:9099/admin?admin@admin2"

In this example, the script imports the metadata of the file export.vql into two Servers.

Example 2:

import --singleuser -f export.vql -s servers.conf

In this example, the script imports the metadata of the file export.vql and reads the URIs of the target Servers from the file servers.conf.

Importing the Metadata from a Repository

Use the following syntax to import the metadata of a Repository into one or more Servers.

Besides importing the metadata of the Repository to a Server(s), the script can instead, create a single file with all VQL statements of the Repository. To do this, use the option --file.

Note

If you want to store and import the metadata of the Server in/from a VCS, we recommend using the VCS integration of Virtual DataPort (see section Version Control Systems Integration).

Syntax of the import script (importing from a repository)
import --repository <path to repository>
     [ {   --element <path to element>
         | --repository-element <identifier path> } ]*
     [ --property <property name> = { yes | no } ]*
     {   --server <server URI> [--server <server URI>]*
       | --servers-file <servers file>
     }
     [ --file <output file> ] [ --singleuser ]
Parameters of the import script when importing from a repository

Parameter Name

Description

-h

--server <host>: <port>/<database> ?<user>@<password>

URI of the Server.

If you want to use an encrypted password, use the script encrypt_password to obtain your password, encrypted.

In this case, the value of this parameter must be prefixed with encrypted:

E.g.:

//localhost:9999/admin?admin@encrypted:Gr16MjvuXhRzPtPH/yTXHw==

-s

--servers-file

Instead of using the parameter --server, you can provide the path to a file that contains the URIs of Servers to which the metadata will be imported.

Each URI has to be indicated in a separate line, with the same syntax of the parameter --server.

-r

--repository

Path to the directory of the Repository.

-e

--element

Path inside the repository of the element you want to import. Use this option if you only want to import some elements of the Repository.

E.g. /databases/admin/view s/incidents.vql

If you want to import an element and its dependencies, add the property includeDependencies.

E.g.: --property includeDep endencies=true

-re

--repository-element

The identifier path of an element stored in the repository

Syntax: database:type[:subtyp e]:[folderPath/]name

E.g. admin:view:/incidents .vql

The available types are datasource, view, webservice, storedprocedure, folder, database.

The value of subtype can be custom, df, essbase, jdbc, json, ldap, mongodb odbc, olap, salesforce, sapbwbapi, saperp, ws, xml.

-su

--singleuser

If present, the import script will execute the statement ENTER SINGLE USER MODE before executing the VQL statements of the file. At the end, the script will execute EXIT SINGLE USER MODE.

By doing this, Virtual DataPort switches to single user mode while importing the file.

Note: you are strongly advised to import metadata in a Virtual DataPort server in single user mode.

-d

--dependencies

Add this to import a single element including its dependencies (except jars) when importing from a repository.

This parameter is deprecated.

-P

--property

Set of settings that control the import process. You can specify one or more properties with this syntax:

<property name> = {yes | no}

Properties than can be passed to the import script (–property parameter): importing from a repository lists the available properties.

The properties that control the import process (-P, --property) are the following:

Properties than can be passed to the import script (--property parameter): importing from a repository

Possible Arguments for --property

Description

includeCreateDatabase

Only valid when importing an entire database and not when importing an entire repository or just some elements of it.

If yes, the script executes the statements that recreate the exported database and restore its configuration. For example:

DROP DATABASE IF EXISTS <exported db name>;
CREATE DATABASE <exported db name>
ALTER DATABASE <exported db name> CACHE OFF;

If you export all the metadata of a Server, the output already includes the statements to create the databases.

Default value: no.

includeDependencies

If yes, the script imports the elements of the parameters selected with the parameters

--element or --repository-element and also imports their dependencies (except jars).

For example, if the value of this parameter is yes and you are importing a derived view, the script also imports the base views and data sources that are required to create this view.

Default value: no.

includeJars

If yes, the script imports the jar files that were exported from the Server. Otherwise, they are not imported.

Default value: no.

includeEnvSpecificElements and includeNonEnvSpecificElements

These options have to be used together to:

  • Only import elements that depend on the environment such as data sources, users and their privileges, JMS listeners, Server settings, etc.

  • Or, only import elements that are independent of the environment such as views, Web services, etc.

With the following options, the script only imports the metadata of elements dependent on the environment:

-P includeNonEnvSpecificElements=no

-P includeEnvSpecificElements=yes

With the following options, the script imports the metadata of the elements that are independent of the environment:

-P includeNonEnvSpecificElements=yes

-P includeEnvSpecificElements=no

The section Exporting Environment-Dependent and Independent Elements to Different Files lists which elements are considered dependent on the environment and which are not.

Note: these options are deprecated and should not be used. The option includeProperties should be used instead.

includeDeployments

If yes, the script imports the deployment state of the Web Services that are being imported.

Default value: no.

Example 1

import --singleuser --repository "C:/repository"
  --server localhost:9999/admin?admin@admin
  --server acme:12999/testing?admin@encrypted:iGTAJvv6CjEd1EvBVZyO4SSkgYCE7Z2C5PMZBLRUYk2YgeibnNZmk4HyTDcecoZuounNgjKxbsh1GO5bXjpRlRIkHOUaaVMj4INs7G3bLa3AE/1MGgSfiv3V4oC/1RVf

In this example, the script imports the content of the Repository located in the path C:\repository, into two Virtual DataPort servers:

  1. A server running in localhost, port 9999, using the credentials admin/admin.

  2. A server running in the host acme. Note that the password is encrypted.

Example 2:

import --singleuser --repository "C:/repository"
       --servers-file servers.conf

In this example, the script reads the URIs of the target Servers from the file servers.conf and imports the content of the repository into these Servers.

Example 3:

import --singleuser --repository "C:/repository" --file output.vql

In this example, the script creates a file output.vql with all the VQL statements of the Repository. It does not import anything into any Server. It just creates the file.

Add feedback