Getting the contents out of the binary

LevelDataStudio » Use cases » Export the keys

Download LevelDataStudio Free Trial »     Buy LevelDataStudio Now »

The situation

You need the contents somewhere else than in the store: a copy taken before a risky change, a diff between two versions of the same database, a list of keys that a colleague can look at, or values that have to be joined against something in a spreadsheet.

A LevelDB folder is not a deliverable. Copying the folder gives you a binary artefact; the .ldb files are not readable and a diff tool will not tell you what changed.

What you do

  1. Open the database and choose export.
  2. Decide the scope: the whole database, or a range of keys rather than everything.
  3. Choose the format the reader needs - JSON (with pretty printing), CSV, TSV, Excel, XML, SQL or TXT - and any formatting options.
  4. Write the file. Large databases are exported with the same incremental loading as browsing, so a store with millions of pairs does not have to fit in memory.

Exporting LevelDB keys to a file in Level Data Studio

Two exports of the same store at different times, both as sorted CSV or JSON, give you a diff that actually means something - which is the usual way to find out what an application changed in its own store.

What it will not do

Related

The mode itself: export LevelDB keys to files. Loading an exported file somewhere else: import keys from files. Looking before you export: look inside the database. Correcting an entry instead: fix one key by hand.