RavenDB – Exporting and Importing using Smuggler
Smuggler is a tool for RavenDB which is used for exporting and importing data – today at work I was shown a nice way to use it to take production data out and import it locally for just one collection of documents – something which might be useful and I know I will forget the syntax I the future for so blogging about it helps me know remember it and I can always read here again in the future if and more likely when I do forget it.
The syntax for exporting a collection called Categories would be as follows:-
What are we doing here, well we are saying use Smuggler to export from the Catalogue Tenants database a dump file – we are also using metadata so that we are only exporting a collection of documents called Categories and then only the latest version so no revisions, and lastly only export the Documents so no Indexes or any other types of documents.
I wanted to then import this into my local instance of RavenDB so the following command does just that:-
This will import the Categories and override any existing Categories in my local RavenDB instance.
You can read more about smuggler here.
Hope someone finds that useful.