Migrating from SQLite to NoSQL (LiteDB)

93 Views Asked by At

So I was making a simple WPF application for my personal use, backed by SQLite DB. And, as it happens with us amateur developers, realised half-way through that a NoSQL DB would fit my purposes much more.

Found out about LiteDB, everything looks just great for my needs (which is just NoSQL and lightweight, tbh), except that I'm completely at a loss as to how do I migrate my data (which is painfully relational having loads of 1-to-1, 1-to-m, m-t-m connections and small tables holding 3-10 records just representing states) while maintaining at least some of the table links where it's necessary and changing links to embedded objects in other cases.

I realise that some work will have to be done no matter what, since I'm no longer manually querying the DB and creating objects from that data using my custom code, but instantiating them using the table/class identity. I've rewritten the code of my data classes representing those.

But as to actually moving the data - so far I wasn't able to find anything other than creating one-time scripts for each table, extracting the data from SQLite, transforming to fit the new data structure (as in, breaking concatenated strings into separate object since I have embedded arrays now) and loading into LiteDB. Is that how it's habitually done?

Thanks.

0

There are 0 best solutions below