reimport option of the imam command

You can use the reimport option to reimport the most recent staged import in an import area. You can use the reimport option when you use the imam command with the --action parameter.

Purpose

You can use the reimport option to quickly reimport import areas without using the InfoSphere® Metadata Asset Manager user interface.

The express import is automatically shared to the metadata repository unless there are errors. If there are errors, the reimported metadata appears as a new staged import in the staging area, but is not shared with the metadata repository. Depending on your import settings, you might be required to preview the import before it is shared.

You must have the Common Metadata Administrator role, or you must be the Common Metadata Importer who created the import area.

Reconciling imports

When you first import into an import area and share the import to the metadata repository, the metadata is reconciled with existing metadata in the repository. If an imported asset has the same identity as another asset that already exists in the metadata repository, the two assets are merged. Merge rules are used to determine the specific behavior, depending on the object type. When you reimport into the same import area, the reimport logic assumes that you are importing the same basic source metadata. Any assets that were imported in the previous import but are not present in the reimport are assumed to have been deleted in the source. The missing assets are deleted from the metadata repository when the reimport is shared.

Syntax

imam --action reimport --importArea import_area_name
[--localFile local_file_path][--dcAuthFile data_connection_credentials_file_path]
[--dcUser data_connection_user][--dcPassword data_connection_password]
[--username username] [--password password][--authfile credentials_file_path]
 [--server server_name] [--port port_number] [--help] [--silent] [--log] [--checkEventDiff] [--saveDcPassword]

Parameters

When you specify the long name of a parameter, you must type two dashes (--) before the parameter. For example, --action. When you specify the short name of a parameter, type only one dash (-). For example, -a.

Commands that use the reimport option can use the following parameters.

Table 1. Parameters that can be used with the reimport option
Parameter name (short name) Description
--action or -a

Required.

Use the reimport option.

--importArea or -i

Required.

Name of the import area in which the reimport runs. The reimport uses the parameters from the most recent import in the import area. If the import area name contains blank spaces, you must put quotation marks around the blank spaces. If the name contains quotation marks, you must enter a backslash character (\) before each of the quotation marks. For information about other characters that you must escape, see Escaping characters.

--localFile or -l

Optional.

The path to a local file to import. If you are reimporting a file that was previously imported on the local computer instead of the metadata interchange server, you must specify the –localFile. If the previous import was imported on the metadata interchange server, you can choose to use –localFile to reimport from the local computer. The --localFile option is case-sensitive, so you must use a capital "F" when you specify this option.

--dcAuthFile or -dcaf

Optional.

For connector imports. The path to a file that contains the encrypted or non-encrypted credentials to connect to the data source that you are importing from. Do not specify credentials in a file if you are specifying the --dcUser and --dcPassword options on the command line. The credentials in the data connection credentials file override any stored data connection credentials. This parameter is ignored if the data connection credentials are explicitly specified by using --dcUser and --dcPassword. For more information, see the topic Encrypt command and its subtopics.

--dcUser or -dcu

Optional.

Note: This parameter is required if you want to import by using a connector and you did not specify a password in one of the following ways:
  • In the parameters file
  • By specifying --dcAuthFile

For connector imports. The user name that the data connection uses to connect to the data source. The user name that you enter overrides any stored user name that was specified for connecting to the data source. If you use --dcUser, you must also specify --dcPassword.

--dcPassword or -dcw

Optional.

Note: This parameter is required if you want to import by using a connector and you did not specify a password in one of the following ways:
  • In the parameters file
  • By specifying --dcAuthFile

For connector imports. The password that is used by the data connection to connect to the data source. The password that you enter overrides any stored password that was specified for connecting to the data source. If you use --dcPassword, you must also specify --dcUser.

By default, passwords are saved. This default setting is controlled on the Import Settings page of the Administration tab of InfoSphere Metadata Asset Manager.

--authfile or -af

Optional.

Path to a file that contains the encrypted or non-encrypted credentials for logging on to InfoSphere Information Server. If you use the --authfile parameter, you do not need to specify --username or --password on the command line. If you specify both the --authfile parameter and the explicit user name and password parameters, the explicit parameters take precedence over what is specified in the file.

For more information, see the topic Encrypt command and its subtopics.

--username or -u

Optional.

User name that is required for logging in to InfoSphere Information Server. The user must have the role of Common Metadata Administrator or Common Metadata Importer. You can use the --authfile parameter instead of specifying the --username and --password parameters. If you enter a user name without entering a password, you are prompted for a password when you run the command.

--password or -w

Optional.

Password for the specified user name to log in to InfoSphere Information Server. You can use the --authfile parameter instead of specifying the --username and --password parameters.

By default, passwords are saved. This default setting is controlled on the Import Settings page of the Administration tab of InfoSphere Metadata Asset Manager.

--server or -s

Optional.

Name of the services tier computer. If you specify a server, then you must specify a port.

--port or -p

Optional.

Port number to use on the services tier computer. The default HTTPS port is 9443. If you specify a port, you must specify a server.

--silent or -sl

Optional.

Suppresses prompts for credentials and SSL certificates. Use this parameter when you run scheduled or unattended sessions. When a prompt is suppressed, the action fails.

To prevent such failures, provide credentials on the command line or in a credentials file, if necessary, and Run the UpdateSignerCerts command to retrieve the certificate before you schedule a command-line session. .

--help or -h

Optional.

If you use --help with other options, the other options are ignored. Prints the list of actions and parameters. The help command is automatically issued when you issue a command that contains a syntax error, such as a typographical error, an improperly cased parameter or argument, or when the command is missing a required parameter.

--log or -lg

Optional.

Prints runtime log messages to the console while you run the command line. You can use the log to debug issues that arise when you use InfoSphere Metadata Asset Manager. The log includes the details of the HTTPS call that is made to the server, and stack trace information for any exceptions that are thrown.

--checkEventDiff or -ced

Optional.

This option compares assets between current event and the previously shared event. If a previously shared event is not found, this option will be ignored. The assets in the shared repository are ignored for this comparison. The re-import event will stop, if all the assets are the same as previous event. If not, the re-import event will continue.

--saveDcPassword or -sdc

Optional.

The Import does not save DataConnection password by default. When you want to save the DataConnection password, you can use the --saveDcPassword option to save the DataConnection password.

reimport examples

The following command reimports the most recent staged import in the import area area51 from the local computer.
imam –-action reimport --importArea area51 --server 9.184.184.153 --port 9443 
--localFile C:\data.xml --authfile C:\authfile.txt
The following command reimports the most recent staged import in the import area "Customer". The short name commands for all parameters are used. The name of the import area contains quotation marks, so a backslash character (\) is included before each of the quotation marks.
 imam -u isadmin -w password100 -s mds-qa1 -p 9443 -a reimport 
-i \"Customer\" 
The following command reimports the most recent staged import in the import area 'salary'. The short name commands for all parameters are used. Server and port parameters are omitted because the command is being run on the local InfoSphere Metadata Asset Manager server on the services tier.
 imam -a reimport -i 'salary' -u admin1 -w password1  
The following command reimports the most recent staged import in the import area "Department heads. The short name commands for all of the parameters are used. The import area name "Department heads has a space in it, so the whole name needs to be surrounded by quotation marks. There is a quotation mark in the name that needs to be escaped with a backslash character (\).
imam -a reimport -i "\"Department heads" -u admin1 
-w password1 -s mds-qa1 -p 9443 
The following command reimports the most recent staged import in the import area "test" model".
imam -a reimport -i "\"test\" model" -u admin1 
-w password -s mds-qa1 -p 9443
The following command reimports the most recent staged import in the import area db2import1, by using the specified data connection credentials.
imam --action reimport -dcu db2admin -dcw db2admin100 --importArea db2import1 
--server 9.184.184.153 --port 9443 -u isadmin -w isadmin
The following command reimports the most recent staged import in the import area db2import2, by using the authorization file dcauthfile.txt. The authorization file specifies the data connection credentials.
imam --action reimport --dcAuthFile C:\dcauthfile.txt --importArea db2import2 
--server 9.184.184.153 --port 9443 -u isadmin -w isadmin
The following command reimports the most recent staged import in the import area area001, by using the authorization file authfile.txt. There are quotation marks around the directory where the localFile is stored and the directory where the authorization file is stored, because both directories contain folders that have names with spaces in them, such as My Stuff.
imam –-action reimport --importArea area001 --server 9.184.184.153 --port 9443
--localFile "C:\My Stuff\data.xml" --authfile "C:\My Files\ authfile.txt"
The following reimport command compares assets between the current event and the previously shared event and stops the reimport event if all the assets are the same as previous event.
imam --action reimport -i tgt_sample --username isadmin --password isadmin --checkEventDiff