Hi Sergey,

in my experience this kind of bulky jobs are best done with a Groovy script. 
Install the the Groovy module 
(http://documentation.magnolia-cms.com/modules/groovy.html) then run a script 
like the following. Of course, make sure you first check that it works properly 
before saving anything to the JCR repo, that is comment out the hm.save() part. 
The OOM here should be prevented by saving periodically in small chunks (100 
items), because otherwise all 30000 items would be loaded in an in-memory JCR 
session which would be flushed only on saving.

[code]hm = ctx.getHierarchyManager('users')
users = hm.getContent('/admin').getChildren('mgnl:user')

count = 0
users.each { user, i ->
  println "Deleting user $user.name..."
  user.delete()
  count++
  if(i % 100 == 0)
    hm.save()
}
return "Done deleting $count users." [/code]

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=a3744c5e-e62a-40ad-a69c-abe88ecbbc27


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to