The importer is an application used to extract the project from the cdo server database to a local folder. It produces as many zip file as modeling project. It can also be used to import the user profiles model.
The importer also extracts information from the CDO Commit history in order to produce a representation of the activity made on the repository. This information is denominated Activity metadata. See help chapter The commit history view and Commit description preferences for a complete explanation. By default, the importer will extracts Activity Metadata for every commits on the repository. Be aware that the parameter -projectName has no impact on this feature. It will also export commits that do not impact the selected project. Still, it is possible to specify a range of commit using the parameters -to and -from.
Several import strategies are supported by the Importer application:
cdo export
command on the server osgi console.See also Projects - Import job documentation.
|
Important: Importer.bat file uses -vmargs as a standard eclipse parameter. Eclipse parameters that are used by importer.bat override the value defined in eclipse.ini file. So if you want to change a system property existing in eclipse.ini (-vmargs -Xmx3000m for example) do not forget to do the same change in importer.bat. |
The importer needs credentials to connect to the CDO server if the server has been started with authentication or user profile. Credentials can be provided using either -importerCredentials or -importerLogin and -importerPassword parameters. Credentials are required only for Connected import (see Importer strategies section above for more details). Here is a list of arguments that can be set to the Importer (in importer.bat or in a launch config):
Arguments | Description |
---|---|
-importerCredentials | Login and password can be provided using a credentials file. It is the recommended way for confidentiality reason. If the credentials does not contain any password, the password will be searched in the eclipse secure storage. See
how to set the password in the secure storage
This parameter must not be used with -importerLogin or -importerPassword parameters else the importer will fail. To use this property file
Note: Credentials are required only for Connected import (see Importer strategies section above for more details). |
-importerLogin | The importer needs a login in order to connect to the CDO server if the server has been started with authentication or user profile.
-importerPassword must not be used with -importerCredentials else the application will fail. Note: Credentials are required only for Connected import (see Importer strategies section above for more details). |
-importerPassword | This parameter is used to provide a password to the importer accordingly to the login.
If -importerPassword is not used, the password will be searched in the eclipse secure storage. See how to set the password in the secure storage -importerPassword must not be used with -importerCredentials else the application will fail. Warning: some special characters like double-quote might not be properly handled when passed in argument of the importer. The recommended way to provide credentials is through the importerCredentials file or the secure storage. Note: Credentials are required only for Connected import (see Importer strategies section above for more details). |
-hostname | Define the team server hostname (default: localhost). |
-port | Define the team server port (default: 2036). |
-consolePort | Define the team server console port (default: 12036). |
-connectionType | The connection kind can be set to tcp or ssl (keep it in low case) (default: tcp) |
-importType | The backup is available in three different modes:
PROJECT_ONLY to only export the shared modeling projects from the CDO repository to local; SECURITY_ONLY to only export the shared user profile project from the CDO repository to local; ALL to export both. (default: PROJECT_ONLY) |
-repoName | Define the team server repository name (default: repoCapella). |
-projectName | By default, all projects are imported (with the right -importType parameter). Argument "-projectname X" can be used to import only project X (default: *). |
-runEvery | Import every x minutes (default -1: disabled). |
-archiveFolder (deprecated) | Define the folder where to zip projects (default: workspace). This argument is deprecated. Instead you should use -outputFolder (and -archiveProject=true but true is its default value). |
-outputFolder | Define the folder where to import projects (default : workspace). |
-logFolder | Define the folder where to save logs (default : -outputFolder). |
-archiveProject | Define if the project should be zipped (default : true). Each project will be zipped in a separate archived suffixed with the date. |
-overrideExistingProject | If the output folder already contains a project with the same name this argument allows to remove this existing project. |
-closeServerOnFailure | Ask to close the server on project import failure (default: false). |
-backupDBOnFailure | Backup the server database on project import failure (default: true). |
-checkSize | Check project zip file size in Ko under which the import of this project fails (default: -1(no check)). |
-checkSession | Import zip file and open then close session (default: true). |
-errorOnInvalidCDOUri | Raise an error on cdo uri consistency check (default: true). |
-addTimestampToResultFile | Add a time stamp to result files name (.zip, logs, commit history) (default: true). |
-optimizedImportPolicy | This option is no longer available since 1.1.2. |
-maxRefreshAttemptBeforeFailure | The max number of refresh attempt before failing (default: 10). If the number of attempts is reached, the import of a project will fail but as this is due to the activity of remote users on the model, this specific failure will not close the server even with "-closeserveronfailure" set to true. |
-timeout | Session timeout used in ms (default: 60000). |
-exportCommitHistory | Whether the Commit History metadata should be exported (default: true). If the value is false, all other options about the commit history will be ignored. You should also update the "Jenkins Text Finder" configuration to avoid unstable build. See Jenkins Text Finder configuration section |
-from | The timestamp specifying the date from when the metadata will be exported. The timestamp should use the following format yyyy-MM-ddThh-mm-ss.SSS. For example, for the date 03/08/2017 14h28m453ms use the timestamp 2017-08-03T10:14:28.453. It can also be computed from an Activity Metadata model. In that case, this parameter could either be an URL or a path in the file system to the location of the model. The framework selects the closest commit following this date. If omitted, then exports from the first commit of the repository. |
-to | The timestamp specifying the latest commit used to export metadata. The timestamp should use the following format yyyy-MM-ddThh-mm-ss.SSS. For example, for the date 03/08/2017 14h28m453ms use the timestamp 2017-08-03T10:14:28.453. The framework selects the closest commit preceding this date. If omitted, exports to the last commit of the repository. Be careful, due to technical restrictions, this parameter only impacts the range of commit for exporting activity metadata from the CDO server. Using this parameter will not export the version of the model defined by the given date. |
-importCommitHistoryAsText | Import commit history in a text file using a textual syntax (default: false). The file has the same path as the commit history model file, but with txt as extension. |
-importCommitHistoryAsJson | Import commit history in a json file format (default: false). The file has the same path as the commit history model file, but with json as extension. |
-includeCommitHistoryChanges | Import the commit history detailed changes for each commit (default: false). This option is applied for all kinds of export of the commit history(xmi, text or json files). |
-XMLImportFilePath | This option allows to perform the import based on an XML extraction of the repository. It is mandatory for Offline and Snapshot imports, see the Importer strategies section for more details. It is recommended to provide an absolute path. Some arguments related to the server connection will be ignored. Only the arguments -outputfolder and -repoName are mandatory. |
-cdoExport | This option allows to send a snapshot creation command to the server before performing the import as described in
Importer strategies section. (default: false). The -XMLImportFilePath argument is mandatory since the path is used to create and consume the snapshot.
|
-help | Print help message. |
|
If the server has been started with user profile, the Importer needs to have write access to the whole repository (including the user profiles model). See Resource permission pattern examples section. If this recommendation is not followed, the Importer might not be able to correctly prepare the model (proxies and dangling references cleaning, ...). This may lead to a failed import. |
The job contains a post action that verifies that the commit History metadata text file is generated with the parameter exportCommitHistory set to true by default:
If you change the parameter exportCommitHistory to false, the build will become unstable because of this configuration. So you should deactivate the option "Unstable if found" to avoid this warning that does not make sense with this parameter set to false. Don't forget to set it back if you set the value to true again.
The importer does not use the same credentials as the user. It is stored in a different entry in the Eclipse 'Secure Storage'. Storing and clearing the credentials requires a dedicated application that can be executed as an Eclipse Application or using a Jenkins job.
example1: import project
importer.bat -nosplash -data importer-workspace
-closeServerOnFailure true
-backupDbOnFailure true
-outputFolder C:/TeamForCapella/capella/result
-connectionType ssl
-checkSize 10
example2: import user profile model
importer.bat -nosplash -data importer-workspace
-closeServerOnFailure false
-backupDbOnFailure false
-outputFolder C:/TeamForCapella/capella/result
-connectionType ssl
-checkSize -1
-importType SECURITY_ONLY