AnsweredAssumed Answered

Data Migration on Content Model Update(add/delete types)

Question asked by armedia on May 17, 2011
Problem Description:
There is a change in content model that we need to perform and currently there are more than 15,000 documents in the repository. The change that needs to be implemented are:
a) the existing mandatory "aspects" needs to be moved to another type
b)also a new mandatory association needs to be put in.
So what is the preferred methodology to move the existing data to reflect new update content model. Since there would be a data integrity issue when the new model is updated, how can it be achieved?

Example:
The existing model example:
<type name="cm:story">
<title>Story</title>
<parent>cm:content</parent>
<properties>
<property name="sm:name">
<title>Name</title>
<type>d:text</type>
</property>
</properties>
<mandatory-aspects>
<aspect>sm:aspect_submitter</aspect>
</mandatory-aspects>
</type>
To accomplish the following change:

a) Now we remove the aspects and then associate with a new type:

<type name="cm:submitterTest">
<title>Submitter</title>
<parent>cm:content</parent>
<properties>
<property name="sm:name">
<title>Name</title>
<type>d:text</type>
</property>
</properties>
<mandatory-aspects>
<aspect>sm:aspect_submitter</aspect>
</mandatory-aspects>
</type>

b) Finally we need to associate this type to the original type:

<type name="cm:story">
<title>Story</title>
<parent>cm:content</parent>
<properties>
<property name="sm:name">
<title>Name</title>
<type>d:text</type>
</property>
</properties>
<associations>
<child-association name="sm:association_story_to_submitter">
<title>Story to Submitter Association</title>
<source>
<mandatory>true</mandatory>
<many>false</many>
</source>
<target>
<class>sm:submitterTest</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
<duplicate>false</duplicate>
</child-association>
</associations>
</type>

Questions:


What is the methodology that I need to follow so that I can be assured all the content in the existing repository reflect the changes pertaining to new model.

Thanks
Balaji.S

Outcomes