-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update Datafile
LiteDB v2
use a different data structure, so if you had a v1
data file will be not compatible with v2
. In this case, you need update your data file.
Update process is just an export/import operation. To do this, you will need last version of shell tool (included in Github release page or Nuget tools folder).
Open your command line and run LiteDB.Shell.exe
:
open my_old_datafile.db -- will open in version v1.0.4/v0.9.0
dump > my_dump_file.dmp
open my_new_datafile.db -- will create a new datafile in v.2.0.0
dump < my_dump_file.dmp
Dump file contains all commands (shell syntax) to re-create your database. It´s like a "insert script" as any RDBMS.
If you don't want this dump file, you can just run:
LiteDB.Shell.exe my-v1-old.db --upgrade my-v2-new.db --exit
From beta/rc to final 2.0 version, LiteDB was updated file version. This was need to fix some problems in indexes structures. To update from this versions, download LiteDB.Shell beta/rc, export data using dump command, and then import, using v2 final release LiteDB.
In shell beta/rc, use:
open beta-rc.db
dump > mydump.dmp
In shell final release
open new-datafile.db
dump < mydump.dmp
Data Modeling
- Data Structure
- BsonDocument
- Object Mapping
- Relationships with Document References
- Collections
- FileStorage
Index
Query
Database
Version 4 changes
Shell