cancel
Showing results for 
Search instead for 
Did you mean: 

How to safely change the content-model to a new one with existing data in Alfresco

hiten_rastogi1
Star Contributor
Star Contributor
Hi,

I have data in alfresco of a certain custom type. I tweaked the custom type by removing some property and changing namespace to prevent namespace collision but  after doing this I can't see the previously loaded data. The question is can I get that data back with the new properties. I can't re-upload the data as the data already exist and alfresco is throwing exception and also the amount of data is huge.

Thanks
3 REPLIES 3

kavilash23
Champ on-the-rise
Champ on-the-rise
If alfresco finds a particular node with an undefined type (which is in your case since you have changed the namespace/type), SOLR would not index that node so you would not be able to find it.
Ideally what you need to do is keep your old model and add in your new model with your new custom type, run a script or java to change find and change all nodes with your old type to the new one. After that sanitizing process then you can discard your old model.

Hi,

How do you suggest that I should proceed with the sanitizing process. One thing that comes in my mind is directly hitting the alfresco database but don't know whether that will be good and also I don't know the tables.

Please let  me know how to proceed on this.

Thanks

You can install javascript console and use the alfresco javascript api to run code to search for the old types and then change them to the new one or create a java util method is to do the same thing.