The DocumentManagementService provides the method migrateRepository to migrate resources in the repository:
RepositoryMigrationReport migrateRepository(int batchSize, boolean evaluateTotalCount) throws DocumentManagementServiceException;
This migration process works sequential from the current version to the next higher version. The count of resources migrated in one execution is limited by the parameter batchSize. Subsequent calls will migrate further resources if there are resources for migration available. After all resources for the migration from one version to the next are processed, subsequent calls will start the migration to the next higher repository structure version.
The migration is complete, if the current version of the repository reaches the target version defined by the repository.
Calling the migrateRepository method with the batchSize parameter set to 0 returns a migration report only without starting a migration job.
Parameter evaluateTotalCount determines if the total count of
resources that need processing in this migration step should be evaluated.
Setting this parameter to false saves performance.
Note
Please make sure that no other write access exist on the repository!
Note that migration should take place in an administrative maintenance read-only
time frame.
The RepositoryMigrationReport object, returned by each call, contains information about the repository structure:
There are two different versions, internal versions are migrated first:
Please refer to the JavaDoc of RepositoryMigrationReport for detailed information.
In case problems in repository access occur or the user is not an administrator, a DocumentManagementServiceException is thrown.
The following Document properties are moved when running the migration job via the RepositoryMigrationReport method:
| Key | Type | Migrated to |
|---|---|---|
| description | String | Document.description (if both exist appended with separator ';') |
| comments | String | Document.revisionComment. Note that the comments are not migrated, but just removed from metaData. To specify a version comment when versioning files use versionDocument as described in section Versioning Documents. |
| DocumentTemplate | String | Document.documentAnnotations via Interface PrintDocumentAnnotation#templateType |
| faxEMailMessageInfo | Map<String,Serializable> | Document.documentAnnotations via Interface CorrespondenceCapable |
The key comments representing a version comment cannot be migrated. To specify a version comment when versioning files, use the following functionality:
To retrieve the version comment of the revision represented by a given document use object.getRevisionComment of the Document class:
String getRevisionComment();