JavaBlog.fr / Java.lu DEVELOPMENT,Documentum,ECM Documentum : Moving Content Files via Administration Method MIGRATE_CONTENT (1/3)

Documentum : Moving Content Files via Administration Method MIGRATE_CONTENT (1/3)

Hello,

After, my first post Documentum : Administration Methods : Presentation and examples GET_PATH, DO_METHOD, CHECK_SECURITY, GET_FILE_URL concerning the administration methods, I propose to focus on content’s migration, especially via:

  • 1. MIGRATE_CONTENT administration method
  • 2. Records migration job
  • 3. Migration Policy (need of Documentum Content Storage Services license)

 
 
 

1. MIGRATE_CONTENT ADMINISTRATION METHOD
 
The MIGRATE_CONTENT method allows the moving of multiple content files from a file store, ca store, blobstore or distributed store.
 
Examples of use of DCTM API:
Example 1:
The below query moves all objects from filstore_01 to fl1. The log file identifies the messages generated by the method.

API> apply,c,NULL,MIGRATE_CONTENT,SOURCE_STORE,S,filestore_01,TARGET_STORE,S,fl1,LOG_FILE,S,C:\temp\gen1.log,REMOVE_ORIGINAL,B,T

 
Example 2:
The above query moves all objects that were created after 23.06.2009 from filestore filestore_01 to target store fl1 via a query specified to move objects based on a criteria:

API> apply,c,NULL,MIGRATE_CONTENT,TARGET_STORE,S,fl1,QUERY,S,r_creation_date > DATE('23.06.200900:00:01'),SYSOBJECT_QUERY,B,T,LOG_FILE,S,C:\temp\gen.log,REMOVE_ORIGINAL,B,F

 
 
 
Use of migrate_content method:
The method moves content files from one storage area to another and returns a collection with one query result object. The object has one integer property, named result, whose value is the number of contents successfully migrated.

EXECUTE migrate_content [FOR] object_id
WITH target_store='target_storage_name'
[,renditions=value][,remove_original=TRUE|FALSE][,log_file='log_file_path']
[,source_direct_access_ok=T[,direct_copy=T
[,update_only=T,command_file_name='command_file_name']]
|,source_direct_access_ok=T[,direct_move=T
[,update_only=T,command_file_name='command_file_name']]
]

 
 
WARNING:The method operates on dmr_content objects, resetting their storage_id property to the new storage area and resetting the data ticket property. It also updates the i_vstamp property. The i_vstamp property is also incremented for any SysObject that contains the content file as the first primary content (page 0). Similarly, if the content objects are associated with persistently cached objects, the next time the cached objects are accessed by the client, they will be refreshed. So, if you try to save an object associated with dmr_content objects after its migration (in same session), you could obtain the following errors unless you did a docObject.fetch(…) :
DfException:: THREAD: http-0.0.0.0-0.0.0.0-9080-5; MSG: [DM_SYSOBJECT_E_CANT_SAVE]error: “Cannot save 090xxxxxxx15 sysobject.”; ERRORCODE: 100; NEXT: DfException:: THREAD: http-0.0.0.0-0.0.0.0-9080-5; MSG: [DM_SYSOBJECT_E_VERSION_MISMATCH]error: “save of object failed because of version mismatch: old version was 30”; ERRORCODE: 100; NEXT: null

Followed by: DfException:: THREAD: http-0.0.0.0-0.0.0.0-9080-5; MSG: [DM_SYSOBJECT_E_VERSION_MISMATCH]error: “save of object failed because of version mismatch: old version was 30”; ERRORCODE: 100; NEXT: null


Invoking administration methods via DA

To execute an administration method manually, use Documentum Administrator in the node (Administration/Job Management/Administration Methods).


Invoking administration methods via DQL

To execute an administration method in an application, use the DQL EXECUTE statement. You can also use EXECUTE to invoke an administration method through IDQL.

Note : It’s possible to use IDQL32.exe or IAPI32.exe in order to execute DQL or API commands. The scheduling could be done via OS tasks (like Windows Scheduled).
 
Example:

EXECUTE migrate_content FOR '090xxxxxxxxx70' WITH target_store='centera_store_no_retention',renditions='all',remove_original=TRUE;
<em>...outputs:</em>
result=2

 
 
Example of testimony found on internet:
Migration of 8.5 Terabytes of content from one file store to multiple file stores. I expect to be doing this for a while, but it is working fine.
Right now I am 3TB into the process and I have almost filled one of my target filestores.
I run everything in RepoInt running on the Content Server directly. The command (with different filestore and object type names) that is running is:

Execute MIGRATE_CONTENT With
target_store='filestore_new',
max_migrate_count=100000,
parallel_degree=10,
remove_original=True,
sysobject_query=True,
log_file='c:\temp\ContentMoveLog37.tst',
query='r_object_id in (select r_object_id from custom_document_type where a_storage_type = ''filestore_01'')'

As you can see, I am on my 37th batch. I have played with the max_migrate_count to get it to run how long I desire. With my content profile, the 100,000 documents will take me 10 hours, but your mileage will vary. I would migrate 10,000 items first and time it. That 10K will be a longer 10K on average, but it will give you a baseline.
Only run one of these queries at a time. I had some minor issues. I think I could do it safely, but in general, one at a time should allow you to monitor progress quite readily.
In general, I am trying to move static images from my primary filestore to a new filestore that is designed to better handle my static content. This allows my primary content filestore to focus on just the basic Documentum reports and miscellaneous standard content.


Invoking administration methods via API with APPLY instruction

To execute an administration method in an application, use the specific API instruction APPLY. You can also use these instructions through IAPI. The API Apply method is the API equivalent of the DQL EXECUTE statement. The Apply method returns a collection identifier for a collection that contains the results of the specified method.

Note : It’s possible to use IDQL32.exe or IAPI32.exe in order to execute DQL or API commands. The scheduling could be done via OS tasks (like Windows Scheduled).
 
Example:

API: apply,c,content_obj_id,GET_APTH,STORE,S,filestore_id

 
Example:

API> apply,c,090xxxxxxxxx70,MIGRATE_CONTENT,TARGET_STORE,S,centera_store_no_retention,RENDITIONS,S,all,REMOVE_ORIGINAL,B,T
API> next,c,q0
API> get,c,q0,result

…outputs:

API> apply,c,090xxxxxxxxx70,MIGRATE_CONTENT,TARGET_STORE,S,
centera_store_no_retention,RENDITIONS,S,all,REMOVE_ORIGINAL,B,T
...
q0
API> next,c,q0
...
OK
API> get,c,q0,result
...
2

Invoking administration methods via DFC – getSession().apply(…)

To execute an administration method in an application, use the IDfSession.apply method. For information about using IDfSession.apply to invoke an administration method, refer to the Javadocs.

Note : It’s possible to include this code in a custom job executed by dm_agent_exec.

	public void migrationWithSessionApply(String objectId) throws Exception {
		System.out.println("----- migrationWithSessionApply("+objectId+")");
		IDfCollection dfCollection = null;
		try {
            IDfList args = new DfList();
            IDfList dataType = new DfList();
            IDfList values = new DfList();
            //
            args.appendString("TARGET_STORE");
            dataType.appendString("S");
            values.appendString("centera_store_no_retention");
            //
            args.appendString("RENDITIONS");
            dataType.appendString("S");
            values.appendString("all");
            //
            args.appendString("REMOVE_ORIGINAL");
            dataType.appendString("B");
            values.appendString("T");
            //
            dfCollection = idfSession.apply(objectId, "MIGRATE_CONTENT", args, dataType, values);
			if(dfCollection !=null && dfCollection.next()){
				System.out.println(dfCollection.getString("result"));
			}
		}finally{
			if(dfCollection!=null){
				dfCollection.close();
			}
		}
	}

…outputs:

----- migrationWithSessionApply(090xxxxxxxxx70)
2

Below, an example of BEFORE/AFTER execution on a specific document:

 * ----- BEFORE MIGRATION (primary rendition and XML rendition)
 * API> getpath,c,090xxxxxxxxx70
 * ...
 * \\MYSERVER\data\MY_DOCBASE_DEV\content_storage_01\xxxxx\80\22\c9\6e.dxl
 * 
 * API> getpath,c,090xxxxxxxxx70,,xml
 * ...
 * \\MYSERVER\data\MY_DOCBASE_DEV\content_storage_01\xxxxx\80\22\c9\6f.xml
 *  
 * ----- AFTER MIGRATION (primary rendition and XML rendition)
 * API> getpath,c,090xxxxxxxxx70
 * ...
 * 04C8NCQ77GJ9XXXXXXXXXXXXX3UBMNVECR6QGB
 * 
 * API> getpath,c,090xxxxxxxxx70,,xml
 * ...
 * FC9VKAJ2UNJ3VXXXXXXXXXXXXXXXXXX1NUAV

Invoking administration methods via DFC – DfAdminCommand.getCommand(…)

There is an alternative to execute an administration method in an application DfAdminCommand.getCommand(…).

Note : It’s possible to include this code in a custom job executed by dm_agent_exec.

	public void migrationWithApplyMigrateContent(String objectId) throws Exception {
		System.out.println("----- migrationWithApplyMigrateContent("+objectId+")");
		IDfCollection dfCollection = null;
		try {
			IDfApplyMigrateContent applyMigrateContent = (IDfApplyMigrateContent) DfAdminCommand.getCommand(IDfAdminCommand.APPLY_MIGRATE_CONTENT);
			applyMigrateContent.setContentId(new DfId(objectId));
			applyMigrateContent.setTargetStore("centera_store_no_retention");
			applyMigrateContent.setString("RENDITIONS", "all");
			applyMigrateContent.setRemoveOriginal(true);
			applyMigrateContent.setLogFile("C:\\temp\\migration_2.log");
			dfCollection = applyMigrateContent.execute(idfSession);
			//dfCollection = applyMigrateContent.execute(idfSession.getSessionManager().newSession("MY_DOCBASE_DEV"));
			if(dfCollection !=null && dfCollection.next()){
				System.out.println(dfCollection.getString("result"));
			}
		}finally{
			if(dfCollection!=null){
				dfCollection.close();
			}
		}
	}

…outputs:

----- migrationWithApplyMigrateContent(090xxxxxxxxx70)
2

Below, an example of BEFORE/AFTER execution on a specific document:

 * ----- BEFORE MIGRATION (primary rendition and XML rendition)
 * API> getpath,c,090xxxxxxxxx70
 * ...
 * \\MYSERVER\data\MY_DOCBASE_DEV\content_storage_01\xxxxx\80\22\c9\6e.dxl
 * 
 * API> getpath,c,090xxxxxxxxx70,,xml
 * ...
 * \\MYSERVER\data\MY_DOCBASE_DEV\content_storage_01\xxxxx\80\22\c9\6f.xml
 *  
 * ----- AFTER MIGRATION (primary rendition and XML rendition)
 * API> getpath,c,090xxxxxxxxx70
 * ...
 * 04C8NCQ77GJ9XXXXXXXXXXXXX3UBMNVECR6QGB
 * 
 * API> getpath,c,090xxxxxxxxx70,,xml
 * ...
 * FC9VKAJ2UNJ3VXXXXXXXXXXXXXXXXXX1NUAV

Best regards,

Huseyin

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

Related Post