0

I have two content store defined in content-store-selector-context.xml file .

First one is default content store and another content store in different physical location(storeB) .
Once in month i need to move files from default conent store to into storeB .

I am planning to use scheduler which will invoke a script . script should move files from default to storeB. (PS:-Not copying)

Both content store is viewable from same server.

I was using following script , but this copy the file to storeB but not removing from default content store . Can i know anything wrong in this script or please suggest different approach if any

var logFile = space.childByNamePath("alf docs1.txt");
logFile.addAspect("cm:storeSelector");
logFile.properties['cm:storeName'] = "storeB";
logFile.save(); 
B25Dec
  • 2,301
  • 5
  • 31
  • 54
  • How do you determine that the node is copied? – Lista Feb 03 '20 at 18:17
  • When i look at physical location in second content store , the document should be available there . – Brijesh N K Feb 04 '20 at 09:56
  • Get the destination node in the other content store, then [use the move method](https://docs.alfresco.com/5.2/references/API-JS-move.html)? – Gagravarr Feb 04 '20 at 10:03
  • Thanks for the comment , move will not work in my case . In fact i was trying to follow approach mentoned in API doc https://docs.alfresco.com/5.2/concepts/store-using.html , it was mentioned that ': The original content created in the default store will still exist and will be linked to the copy in the new named store location. If you do not want this to occur, the cm:versionable aspect needs to be removed from the content before applying the cm:storeSelector aspect, and then re-applied after the cm:storeSelector aspect has taken affect.' – Brijesh N K Feb 04 '20 at 10:58
  • 1
    This should work. Take a look at the node in the node browser. Does the content store reflect what you expect? If so, I wouldn't expect the old node to be removed until the orphan cleaner runs. – Jeff Potts Feb 07 '20 at 21:17

0 Answers0