Last Updated: February 25, 2016
·
2.184K
· purekrome

Exporting/Importing a Document Collection from RavenDb

Why ?

  • Export a live collection to a file, copy it to your dev machine, restore and test.
  • Backup a collection before you try patching/changing.

Backup Command Line Summary

Raven.Smuggler.exe
    out   
    http://<server>:<port>/databases/<tenant>  
    "<path-to-output-file>"  
    --metadata-filter=Raven-Entity-Name=<collection>
    --operate-on-types=Documents.

Example

Raven.Smuggler.exe out http://localhost:8080/databases/MusicStore "C:\Temp\Users.dump" --metadata-filter=Raven-Entity-Name=Users --operate-on-types=Documents

Restore Command Line Summary

Raven.Smuggler.exe
    in   
    http://<server>:<port>/databases/<tenant>  
    "<path-to-backup-file>"

Example

Raven.Smuggler.exe in http://localhost:8080/databases/MusicStore "C:\Temp\Users.dump"