Using Repos_Copy

Repos_copy is a command line interface for working with integration components and InterChange Server Express repositories. It allows you to deploy a package--a collection of integration components--to a server repository, or to export components from the repository to a package.

To run repos_copy, enter the command in an MS-DOS command prompt window. The ProductDir/bin directory, where the utility resides, should be in your path as a result of installation.

Note:
The repos_copy output file contains encrypted passwords for relationships and connector applications. If you try to edit the output file and change these passwords, repos_copy will not work.
Important:
When repos_copy deploys components to the repository, it deploys them to the repository only. It does not deploy them to any in-memory tables of business object definitions. For instance, connectors load business object definitions from the repository into their memory space when they start. If you deploy a business object definition to the repository to update it, you must restart the connector agent so that it loads the modified business object definition into memory. You must therefore stop and restart InterChange Server Express and components that load definitions into memory for them to load recently deployed components.

This chapter has the following sections:

Repos_copy syntax

Table 9 describes the options of repos_copy and their arguments, and shows the correct case usage for the options and the lack of spacing between the option and its argument. The syntax shows that the options between curly braces ({}) represent a set of options that are required. If you do not specify the -u, -p, -i, -o, or -s options at the command line, then repos_copy prompts you for them. If you do not specify them when prompted, repos_copy does not execute. Options enclosed in brackets ([]) are optional.

repos_copy [-sserverName][-uusername][-ppassword] 
 {-i[filename1][-rrelationshipName[relationshipName2]][[-k][-ai|-ar|-arp]
 [-xcompilePackage][-vp|-vr]}
 {-o[outfilename[[-fEntityFile][-eEntityType:Entity1[+EntityType:Entity2][+...]]
 [-deep][-summary]}
 {[-d]|[-doEntityType:Entity[+EntityType:Entity2][+...]|
 [-dfoEntityType:Entity[+EntityType:Entity2][+...]}
 {-v}
 {-vr}
 {[-xCompileAll]|[-xCompileAllCollabs]|[-xCompileAllMaps]|
 [-xCompileCollab:collabTemplateName[+collabTemplateName][+...]]|
 [-xCompileMap:nativeMapName[+nativeMapName][+...]]}
 


Table 9. Repos_copy command options
Option Description
-ai

Ignore and do not load any duplicate objects (business objects, maps, relationships, collaboration templates and objects, and connectors) that are found when deploying a package.

-ar

Replace any duplicate objects (business objects, maps, relationships, collaboration templates and objects, and connectors) that are found when deploying a package.

Note:
The -ar option only works with release 4.2.0 or later.
-arp

This is an interactive version of the -ar option. If the components in the package being deployed already exist in the repository then repos_copy displays a prompt asking if you want to ignore or replace the component.

Note:
The -arp option only works with release 4.2.0 or later.
-d

Deletes the components in the repository, except the state data. Use this option to delete all of the components from the repository.

-deep

Used with the -e option when you want to include all the dependent components. If you omit the -deep option, only the component that is specified with the -e option will be included.

-dfoEntityType:Entity[+EntityType:Entity2]

This option is the same as the -do option except that it will forcefully delete the component even if the component has referents that depend on it. This option only works with the repository of a server that is running in design mode. A server that is running in production mode does not permit unresolved dependencies and references.

-doEntityType:Entity[+EntityType:Entity2]

Specifies the entities to be deleted from the repository. See Table 10 for the list of entity types and keywords. If the object has no referents--other components that depend on it--then the deletion takes place. If the object has referents, then the deletion fails and a message is displayed. The behavior is the same in both design mode and production mode. For more information about starting the server in design mode or production mode, see the System Implementation Guide.

-eEntityType:Entity1[+EntityType:Entity2...]

Exports one or more referenced first-class entities. A first-class entity is a business object, collaboration object, collaboration template, connector, database connection pool, map, or relationship. You identify the entity to load or unload by specifying one of the keywords in Table 10.

Follow the EntityType keyword with a colon (:) and the name of the entity. Use the "+" to specify more than one entity. When combined with the -o option, the -e option unloads the data to an output file.

-fentityFile

This option is similar to the -e option except that the names of the entities to be imported are stored in a file. The file should contain references to the entities, with the following conditions:

  • The entity names must follow after the proper entity type keyword. The entity types and their keywords are listed in Table 10.
  • A colon must separate the entity type from the entity name.
  • There must be a new line separating each entity reference.

When combined with the
-o option, this option exports the components to a package.

-ifilename

Deploys the specified package file to the repository. If you omit the input file name value, the command interactively prompts you to enter the name of the input file. The file can be either a .jar file containing objects in XML format, or a file in text format from a release prior to 4.2.0.

The .jar files created by repos_copy or System Manager have a particular structure which must be maintained for any subsequent imports of such a file to be successful. You should not, therefore, ever modify an input file manually.

-k

Overrides the default behavior of repos_copy when it finds a Mercator map in the package file it is loading. By default, repos_copy exits if it encounters a Mercator map. If you use the -k option, repos_copy skips over any Mercator maps in the package file and proceeds with the deployment process.

-mode

Returns the mode of the server.

-ncencoding

Specifies the character encoding when importing a text-based repository file fromreleases prior to 4.2.0.

For a list of valid character encodings, see the Java documentation about the String class.

-ooutfilename

Exports the components in the repository to the specified package file. You must specify the name of the package file. If the file already exists then repos_copy prompts you to overwrite it or not. The output file is in .jar format, and contains the component definitions in XML format, as well as .java source files for components that have them. This option cannot be combined with the -i or -d options, nor can it export components in text format as it did in previous releases. Repos_copy does not append the .jar extension, so you must specify it when specifying the name of the output file.

-ppassword

Specifies the password for the user name supplied with the -u option. The password case-sensitive. If you do not specify this option then repos_copy prompts you for the password.

-r*

This option is similar to the -r option; it allows you to import relationship definitions and not create the runtime schemas for any of them.

-rrelationshipName1[:relationshipName2]

Loads the named relationship definition(s) into the repository without creating its runtime schema.

-sserverName

Specifies the name of the InterChange Server Express instance with which repos_copy should interface. The name is case-sensitive. If the server name is not specified, the tool prompts for a server name.

-summary

This option prints a list of components in the server repository (they are identified as "artifacts" rather than as components in the output). The output is in XML format. You can combine this option with the -o option to print the output to a file rather than the console.

-uusername

Specifies the user name to log in to InterChange Server. If no user name is specified, repos_copy prompts for a user name.

-v

Prints the version number of the program that the repos_copy utility executes.

-vp

This option validates a package file. The server validates packages against the repository and makes sure that the dependencies among the components in the package are resolved. If the validation is not successful, repos_copy prints a list of the missing dependencies. This option does not make any changes to the repository; it just validates the package file. When using the -vp option you must also use the -i option to specify the package file to be validated.

-vr

This option validates the repository. The output message indicates whether the validation is successful or not. If the validation is not successful, repos_copy prints a list of the missing dependencies.

-wi

When this option is specified, repos_copy does not display any warnings that occur during the compilation of collaboration templates or maps. Only errors that occur during compilation are displayed. This allows the user to ignore warnings about deprecated methods, for instance.

-xCompileAll

Compiles all collaboration templates and maps in the repository. Valid only for collaboration templates and maps created using release 4.2 or later.

-xCompileAllCollabs

Compiles all collaboration templates in the repository. Valid only for templates created using release 4.2 or later.

-xCompileAllMaps

Compiles all maps in the repository. Valid only for maps created using release 4.2 or later.

-xCompileCollab:collabTemplateName[+collabTemplateName]

Compiles the specified collaboration templates in the repository. Valid only for templates created using release 4.2 or later.

-xCompileMap:nativeMapName[+nativeMapName]

Compiles the specified maps in the repository. Valid only for maps created using release 4.2 or later.

-xCompilePackage

This option automatically compiles the package being deployed to the server. Since the production-mode server automatically compiles all packages, this option applies only to design-mode servers. For a full description of InterChange Server Express modes, see the System Implementation Guide.

Note:
This option works only if you are deploying components from release 4.2. If the components are from a prior release, this option will be ignored.

Table 10. Keywords for different entity types
Entity type Keyword
Business object BusObj
Collaboration object Collaboration
Collaboration template CollabTemplate
Database connection pool ConnectionPool
Connector Connector
Map Map
Relationship Relationship

Repos_copy usage scenarios

This section describes many of the common situations in which you will use repos_copy. It contains the following sections:

Printing the repos_copy command

You can run repos_copy without any arguments to have the command and its arguments printed out. The example below shows repos_copy when executed without any arguments, and the resulting output:

C:\>repos_copy
 No Command line arguments to ReposCopy were specified
 Usage: repos_copy {-o[outputFile] | -i[inputFile]}
     [-sserverName] [-uuserName] [-ppassword]
     [-ai] [-ar] [-arp] [-d] [-k] [-v]
     [-eentityType:entityName1[+entityType:entityName2] -deep]
     [-fentityFileName]
     [-rrelationshipName1[:relationshipName2] ]
     [-xCompileAll] [-xCompileAllCollabs] [-xCompileAllMaps]
     [-xCompileCollab:collabTemplateName[+collabTemplateName]]
     [-xCompileMap:nativeMapName[+nativeMapName]]
     [-xcompilepackage]
     [-mode]
     [-doentityType:entityName1[+entityType:entityName2] -deep]
     [-dfoentityType:entityName1[+entityType:entityName2] -deep]
     [-summary]
     [-vp]
     [-vr]
 

Validating a package

You can validate a package of components before deploying the package to a server. This is very useful because if you deploy a package to a production-mode server all the dependencies must be resolved or the deployment will fail. You cannot validate a user project or integration component library in System Manager to make sure that the dependencies are satisfied, so the only way to find out if a package is valid when deploying with System Manager is to attempt the deployment and use the error information when it fails to resolve the dependencies. If there are many components in the package, this can be a very time-consuming process.

Although you cannot validate an integration component library, you can export it to a package file and then validate the package file using repos_copy.

To validate a package file using repos_copy, use the -i option to specify the name of the package file to be validated and the -vp argument to validate it rather than deploy it.

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -iWebSphereICS420DEVServer.jar -vp
 

Repos_copy validates the contents of the package and displays a message to indicate whether or not the dependencies are resolved.

Deploying a package to the repository

The -i option allows you to deploy a package of components to the repository. If you do not specify the name of the package file then you are prompted to enter it.

The following example shows a a file named WebSphereICS420DEVServer.jar being deployed to a repository:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -iWebSphereICS420DEVServer.jar
 

Working with duplicate components during deployment

Commonly there will be components with the same name in the package file as there are in the repository. In this case you must decide whether or not you want to replace the components in the repository with those in the package file. The -ai option specifies that duplicate components should not be loaded into the repository:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -iCustomer.jar -ai
 

If you want to replace all the duplicate components in the repository, use the -ar option as in the following example:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -iCustomerSyncInterface.jar -ar
 

You can use the -arp option to interactively replace duplicate components in the repository. This lets you decide for each individual duplicate component whether it should be replaced or not.

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -iCustomerSyncInterface.jar -arp
 

Compiling and creating schemas

For maps and collaboration to execute at runtime, the maps and collaboration templates defined in the repository must be compiled. For relationships to function properly at runtime, their schemas must be created.

When you deploy components to a server running in production mode, all templates are automatically compiled and all relationship schemas are created. For the deployment to succeed, then, the code of the map and collaboration templates must be valid and InterChange Server Express must be able to communicate with the databases specified in the settings of the relationship definitions.

When you deploy components to a server running in design mode, the templates are not automatically compiled; relationship schemas are automatically created. There are options you can use to compile the templates, however, and there are options to not create relationship schemas.

The following example uses the -xCompilePackage option and does not use any form of the -r option. The result is that when the package specified by the -i option is deployed, the maps and collaboration templates are compiled and schemas are created for the relationships:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -iWebSphereICS420DEVServer.jar -xCompilePackage
 

You may not want relationship schemas created when you do a deployment. For instance, if you are deploying a package from one environment to another and did not change the properties of the relationships to use the database resources in the new environment then you will not want the schemas created until after you have changed the relevant properties. The following example uses the -r* option to not create schemas for all of the relationships in the package being deployed:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -iWebSphereICS420DEVServer.jar -xCompilePackage -r*
 

Note:
You can use the -r option without the asterisk to specify the names of individual relationships whose schemas should not be created. For instance,
-rCustomer:Order would not create schemas for the Customer and Order relationships, but would still create schemas for any other relationships in the package being deployed.
Important:
Although there are options to compile maps and collaboration templates after deployment, there is no way to either through repos_copy or System Manager to create the schema for a relationship other than during deployment. So, if you chose not to create the schema for a relationship during deployment because you needed to change the database settings, then you need to re-deploy the relationship afterwards and allow repos_copy to create the schema for the relationship.

Validating the repository

The repository must be in a valid state for a server instance to start in production mode. The reason for this is that ultimately the repository must be valid for the server to process flows successfully. Use the -vr option to validate a server repository, as in the example below:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull -vr
 

If the server is valid then repos_copy writes the following output to the console:

Validation Succeeded.All Dependencies Resolved.
 

If the repository is not valid then repos_copy prints a list of the dependencies that must be resolved.

Compiling components in the repository

If you deployed maps or collaboration templates to the repository and did not compile them during deployment, you can use repos_copy to compile them afterwards. This can be useful in situations where there are many components to deploy because deployment can take a long time and compiling can make the operation take even longer. Waiting until after the deployment has succeeded to do the compilation task can reduce the risk of spending an even greater amount of time migrating the environment if an error occurs.

The following example shows the use of the -xCompileAll option to compile all maps and collaboration templates in the the repository:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -xCompileAll
 

There are options to compile all of either type of component as well. Use
-xCompileAllCollabs to compile all the collaboration templates, and
-xCompileAllMaps to compile all the maps. The example below shows the use of
-xCompileAllMaps:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -xCompileAllMaps
 

Just as you can compile all of one type of component, you can also compile an individual component. Use the -xCompileCollab or -xCompileMap option followed by a colon and the name of the collaboration template or map to compile a single component. The example below would compile a collaboration template named CustomerSync:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -xCompileCollab:CustomerSync
 

Deleting components from the repository

There are several options provided by repos_copy for deleting components in the repository. You can delete the entire repository, individual components, and individual components as well as any components that reference them.

Note:
Components must be inactive for you to delete them. If you delete a single component then you must deactivate it first or the delete operation will fail. If you want to delete a component and all the components that reference it, you must deactivate not only the single component, but all those that reference it as well. You can delete the entire repository while the components are in an active state. Use System Monitor or web-based System Monitor to manage the states of components. System Monitor and web-based System Monitor are described in the User Guide.

Deleting the entire repository

Use the -d option to delete all of the components in the repository. The following example shows the syntax:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin 
 -pnull -d
 

Repos_copy presents a prompt asking if you want to delete the entire repository or not.

Deleting components without referents

If a component does not have any referents--other components that reference it and require it to exist in order to perform their function in the system--then you can delete the individual component.

Use the -do option followed by the entity type, a colon, and the name of the component. The entity types are listed in Table 10. The following example deletes the relationship named Customer:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin 
 -pnull -doRelationship:Customer
 

Deleting components with referents

If a component does have referents--other components that reference it and require it to exist in order to perform their function in the system--then you can only delete the component if the server is running in design-mode, and by using certain options.

Forcing a delete in spite of references

If a component has referents, repos_copy will not let you delete it with the -do option. You must use the -dfo option to force deletion of a component with referents. Forcing deletion of a component that has referents will leave the repository in an inconsistent state, and a server running in production mode does not permit that, so this option only works with a design-mode server. The following example shows the use of the -dfo option to delete the Order business object in spite of the fact that other components in the system (such as maps and relationships) have references to it:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -dfoBusObj:Order
 

Deleting the referents as well

Another way you can delete a component that has referents is to use the -deep option to delete the referents as well. This deletes the component and all of the components that have references to it. The following example shows the use of the -deep option when using the -do option to delete the Customer business object:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -doBusObj:Customer -deep
 

This option, unlike the -dfo option, is supported with servers running in production mode because the deletion of the referents along with the component guarantees that the repository remains valid. Keep in mind, however, that it can result in many components being deleted; you should be aware of the implications of this action prior to taking it.

Exporting components to a package

The -o option allows you to export components from the repository to a package. You must specify the name of the package file. When the -o option is used alone the entire repository is exported to a file, as in the following example:

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -oWebSphereICS420DEVServer.jar
 

You can specify individual components to be exported by using the -e option. You must use the -e option with the appropriate EntityType keyword listed in Table 10, and must follow the keyword with the name of the component. You can specify multiple components by concatenating them with the plus (+) sign. In the following example, the Customer business object and CustomerSync collaboration template are exported to a package named CustomerSyncInterface.jar.

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -eBusObj:Customer+CollabTemplate:CustomerSync -oCustomerSyncInterface.jar
 

You can use the -deep option to export the dependencies of a component as well. In the previous example, the Customer business object was exported, but none of its child business objects were. The following example uses the -deep option to export the CustomerSync_ClarifyToSAP collaboration object and all of its dependencies.

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -eCollaboration:CustomerSync_ClarifyToSAP -oCustomerSyncInterface.jar -deep
 

If you want to export specific components, but do not want to have to enter the entity type keyword and component names, you can store them in a text file and use the -f option. This is very convenient when you want to frequently export the same components. The following example uses the -f option to load the components listed in a text file named Components.txt :

C:\WebSphereICS420DEV>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull 
 -fComponents.txt -oCustomerSyncInterface.jar -deep
 

The contents of the file Components.txt are shown below; a paragraph return follows each entity type keyword and name combination:

BusObj:Customer
 Relationship:Customer
 CollabTemplate:CustomerSync
 
Note:
Repos_copy and System Manager are unfortunately inconsistent with respect to what they identify as "dependencies". If you attempt to delete a component using repos_copy but there are components that depend upon it then repos_copy lists those referring components as dependencies. However, if you right-click the component in System Manager and select Show Dependencies from the context menu the tool lists the components that the selected component depends on.

Printing a list of components in the repository

You can use the -summary argument when executing repos_copy to print a list of the components in the repository. The output is presented in XML format. Although it is not particularly useful to view at the command line, you can combine the -summary argument with the the -o argument to redirect the output to a file and then view the file in a browser or XML editor. The command usage in this case would be the following:

C:\>repos_copy -sWebSphereICS420DEVServer -uadmin -pnull -summary -oRepository.xml
 

Locale for repos_copy files

The repos_copy utility reads metadata from the repository and writes the data out to files in Unicode (UTF-8 format). It also reads such files and loads them into the repository in Unicode (UTF-8 or UCS-2, as the underlying repository database dictates).

Repos_copy files created with Business Integration Express for Item Sync version levels earlier than 4.1.1 can be loaded ino the repository correctly only if the dates and times for the component schedules are in full US format. (This is usually not an issue. Repos_copy saves all schedule dates in full US format only. The incompatibility could typically arise if the repos_copy files have been manually edited.)

Copyright IBM Corp. 1997, 2003