Metadata objects created by DIH may also be migrated leveraging this mechanism, with the list including DIH Parameters, EDS/EDD/Connector definitions, and batches.
Topics:
· Overview
· Exporting Object from Source Environment
· Importing Object into Target Environment
Using the object migration utility, you can migrate (export/ import) DIH metadata objects across different setups. You can specify one or more objects within an object type or multiple object types. You can choose from where the Object Migration utility reads the data, that is, from CSV files or the OBJECTMIGRATION.xml file. For migrating objects using CSV files and OBJECTMIGRATION.xml file, see section Command Line Utility to Migrate Objects from OFSAAI User Guide.
The following sections detail how such Metadata Object migration can be achieved.
Offline Object Migration is a two-step process:
· Exporting Objects from Source Environment
· Importing Objects into Target Environment
For both of these steps, see the sample file OBJECTMIGRATION.xml, which is also present at $MIGRATION_HOME/conf/ in the OFSAAI setup.
Assumptions and Pre-requisites for this process are listed as follows:
· Both the Source and Target environment must be on the same data model version.
· Ensure that the source and target are at the same DIH application level as well as at the same model level before migrating objects from source to target.
· ADI refresh is completed before this process.
· ODI settings are correctly specified in the target environment before importing objects.
· Target datastore refresh is also performed and successful.
· If the exported object already exists in the target environment or an object with the same name already exists in the target environment, then it is overwritten with new definition details.
If the exported Parameter already exists in the target environment, it is not overwritten unless the new definition is of a different Parameter Type. If exported EDS already exists in the target environment, it is not overwritten unless the new definition is of different EDS Types.
· Any exported object, if already exists in target or an object with the same name exists in target then that object and all its dependent objects must be unpublished for migration to go through successfully.
Dependent objects for a Connector are EDS, EDD, and Parameter. Dependent objects for EDD are EDS and Parameter. Parameter and EDS do not have dependent objects.
To export objects from the source environment, follow these steps:
1. Replace placeholders of UserID, Infodom with Source UserID, and Infodom.
2. For $Folder put segment name for the infodom provided. Enter locale as ‘en_US’.
3. $FILE_NAME: Specify the file name which is created under "metadata/archive" folder. For example, mention ‘rules’ in place of $FILE_NAME and you get rules.dmp in the archive folder.
Fail On error: Fail on any error that occurs while restoring metadata. Mention ‘Y’ for Yes and ‘N’ for No.
OVERWRITE: If Metadata exists in the system then Overwrite while restoring metadata. Enter ‘Y’ for Yes and ‘N’ for No.
In Mode tag: mention EXPORT.
For FAILONERROR and OVERWRITE, it’s recommended to mention ‘Y’.
4. In the OBJECT tag, enter “*” for Code property, to export all definitions. If not, for each definition put an equal number of OBJECT tags with map ID and version number in comma-separated format.
Type: Use the following for definitions:
§ 70 for Parameter Definitions
§ 71 for EDS Definition
§ 72 for EDD Definition
§ 74 for Connector Definition
5. The format for the All OBJECTS tag is as follows:
<OBJECTS TargetFolder="DIHUSERS"><OBJECT Code="*" Type="73" /></OBJECTS>
6. For three definitions, the OBJECTS tag is:
<OBJECTS TargetFolder="DIHUSERS">
<OBJECT Code="123221" Type="73" />
<OBJECT Code="321331" Type="73" />
<OBJECT Code="131213" Type="73" />
</OBJECTS>
7. Execute $MIGRATION_HOME/bin/ObjectMigration.sh after providing executable permissions.
8. A file $FILE_NAME.dmp (rules.dmp) is created in $MIGRATION_HOME/metadata/archive
9. Move this file to $MIGRATION_HOME/metadata/restore folder. You can copy the file in the Target environment by creating a "restore" folder under the "metadata" directory (if not available).
10. Exporting definitions from the Source environment is done successfully.
To import objects to the target environment, follow these steps:
1. Repeat 1-3 steps as followed in export mode.
2. In the Mode tag: mention IMPORT.
3. In the OBJECT CODE property, mention “312321”.
NOTE:
Everything that is exported is imported. You cannot choose specific definitions to move.
4. The format for the OBJECTS Tag is:
5. <OBJECTS TargetFolder="DIHUSERS">
6. <OBJECT Code="312321" Type="73" /></OBJECTS>
7. Execute $MIGRATION_HOME/bin/ObjectMigration.sh after providing executable permissions.
8. Check DIH.log for logs. It provides details such as the number of definitions that have successfully moved and other errors. Importing objects to the target environment is done successfully.