cancel
Showing results for 
Search instead for 
Did you mean: 

How can I transfer all data from User A to User B

luupaa
Champ in-the-making
Champ in-the-making
Okey, I have need to migrate/transfer all User A data (like documents, links, discussions) to User B.
User A is disabled, and he can't access to his data, share sites, documents, anything…

Is there any tool to do this. All history and metadata of f.ex documents should be preserved still.
But I can't risk, that something is lost, when User A is disabled.

Some similar kind of software like Alfresco, have features like "Transfer"….
1 REPLY 1

marco_altieri
Star Contributor
Star Contributor
I do not think that there is a tool to do it, but you can search for third party extension.

If you do not find anything, you can use some custom code.
The code below is an example of what you need to do. The code should be executed by an administrator.
You can try it using the javascript console in Share.

Be careful that if there are too many documents created by "usera", this solution could fail or could update only the first 1000 documents: the lucene query does not return more than 1000 documents by default. If the server is slow, the javascript console can time out and rollback all the changes.
If only 1000 documents have been updated, you can of course execute the script again until all the documents are updated.
If the update fails, reduce the max number of documents that can be updated.

A better solution would be to implement this code in java as a custom action.


var nodes = search.luceneSearch('@cm\\:creator:"usera"');

for (var i in nodes) {
  var node = nodes;

  node.addAspect("cm:ownable");
  node.properties["cm:owner"] = "userb";
  node.save();
}