GNOME Bugzilla – Bug 470879
Check if sqlite db is 2.1 and change to 3 if needed
Last modified: 2007-09-19 16:53:00 UTC
Seems that on linux (mono) and on all chronojump versions we used always version 3, but on windows it was 2.1 (on .net) until now: 3 (on mono). The best will be detect with any select and a try{} catch{}, and then try to dump like: sqlite old.db dump | sqlite 3 new.db but do it on the code. If is not possible try to call external programs (sqlite.exe) (sqlite3.exe) redistributed with chronojump, or to call to a batch program that does this piping. On linux we can use also the try {} catch {} and show a message to user telling what packages to install and writing the piped comands.
On linux is working now! on windows there's a hang
On windows crashes this: ProcessStartInfo ps = new ProcessStartInfo(myPath + Path.DirectorySeparatorChar + sqliteStr , sqlite2File + " .dump"); ps.UseShellExecute = false; ps.RedirectStandardOutput = true; string output = ""; using(Process p = Process.Start(ps)) { //TODO: this doesn't work on windows (it gets hanged) p.WaitForExit(); output = p.StandardOutput.ReadToEnd(); } Fixed with: convert_database.bat also in linux with convert_database.sh