-1

Client side: I have a desktop application. The application also has a Sqlite file. I installed it using WIX Toolset on a client machine. When I enter some data in application it gets saved in the database file.

Server side: I made some changes to my application like adding an extra column to a table in database file.

I further installed the new version application from server side .

PROBLEM: as soon as I open my sqlite file from client side, all my previous data is lost. All I get is a blank table.

Question: is it possible to maintain the previous data stored in the database along with the new changes after installation of an upgraded version of application?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
AP7
  • 45
  • 1
  • 7

1 Answers1

1

This is a common problem with MSI that usually expresses itself with XML files but it's the same thing.

MSI can overwrite or not overwrite the file and either way it would be wrong. You want the schema change but you don't want to lose the user data and to MSI the file is atomic.

The best thing to do is use the file installed by MSI as a seed/model, clone it to another directory at application run and store the user data there. On subsequent logon check the seed database for schema changes and programatically migrate the cloned database based on this.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Yes, I agree. We repeat this advice all the time. Put the database somewhere in the user profile? I like network shares better, or a real connection to an online database (cloud). All depends what you can use. Your application should update the database scheme on launch. – Stein Åsmul Apr 22 '19 at 14:18