Skip to content

Instantly share code, notes, and snippets.

@cig0
Last active October 31, 2016 08:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cig0/647ea36211977d00a534 to your computer and use it in GitHub Desktop.
Save cig0/647ea36211977d00a534 to your computer and use it in GitHub Desktop.
Migrating collections from a mongoDB 2.6 mmap database to Percona Server for mongoDB 3.0.8 wiredTiger
# Fixex the error 'Failed: restore error: listDB.lists: error creating collection \
# listDB.lists: error running create command: exception: specify size: when capped is true'
#
# Credits: Juan Pablo Nogueira, https://ar.linkedin.com/in/juan-pablo-nogueira-30645514/en
grep -rl ', "capped" : { "$undefined" : true }, "size" : { "$undefined" : true }' \
/path/to/DB/to/be/restored/* | xargs sed -i 's/, "capped" : { "$undefined" : true }, \
"size" : { "$undefined" : true }//g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment