The Hangout agenda is open to any topics related to deploying edX and running it in production. Add your agenda topics directly to ths document. Joining the hangout does require an invitation. If you need one, please send an email to openedx-operations-hangout@edx.org from the account that you would like us to invite. |
This rough and ready JavaScript has been kicking around for a while, but is too slash-and-burn for real use. It's provided for context only.
var sleep_time=5000 db.modulestore.active_versions.find().forEach(function(doc) { db.modulestore.structures.update({_id:doc.versions['draft-branch']},{$set: {"do_not_delete":1}}) }) db.modulestore.active_versions.find().forEach(function(doc) { db.modulestore.structures.update({_id:doc.versions['published-branch']},{$set: {"do_not_delete":1}}) }) db.modulestore.structures.find({'do_not_delete': { $ne: 1 }}).count() // Danger, danger. Make sure you have a backup and really know what you're doing before uncommenting. // db.modulestore.structures.find({'do_not_delete': { $ne: 1 }}).forEach(function(doc) { sleep(sleep_time); db.modulestore.structures.remove({_id:doc._id});}) db.modulestore.structures.find({'do_not_delete': { $ne: 1 }}).forEach( function(doc) { sleep(sleep_time); db.modulestore.structures.remove({_id:doc._id}); }) db.modulestore.structures.update({},{$unset: { 'do_not_delete':1}}, false, true) |