Litedb: How to migrate database file from 4.1.4 to 5.0.0?

Created on 3 Feb 2020  ·  6Comments  ·  Source: mbdavid/LiteDB

After updating my NuGet package to 5.0.0, I always get the error:

LiteException: This file is not encrypted.

Is there any guideline on how to migrate my existing database files to the latest version?

Thank you very much in advance!

Most helpful comment

Helping is great work, too ;-) xP

All 6 comments

http://www.litedb.org/docs/connection-string/

there's a new "Upgrade" option for the ConnectionString, that should do the tricks, i guess.
remember to keep a backup :)

Awesome. And thank you very much for this fast response :-)
Keep up your great work **mate! ❤

EDIT Just for your information... It worked like a charm!

i'm just a random dude, trying to help, not the dev :P
but thank you too :*

Helping is great work, too ;-) xP

For those using the ConnectionString class instead of an actual string, you can also set the Upgrade property to true

Eg:

var connectionString = new ConnectionString
{
    Filename = "test.db",
    Connection = ConnectionType.Direct,
    Upgrade = true
};

But given that the issue was already resolved by @BangL, I'll close the issue :)

Was this page helpful?
0 / 5 - 0 ratings