Database versioning

I beg of @lubos and/or the community, if any of you have suitably been able to “version” the manager database to determine what version of manager is the lowest version I can open each version of the database with.

What I mean by this, I want to know the lowest version number of manager I need to open any given backup. I don’t want to open a backup in any current version as I want to compare the current output of manager to the old output of manager so I can work out where have gone wrong for me.

If I open the old database in the current version:

  1. It will be updated with whatever structural changes have happened in that time
  2. Report queries and general ledger engines have changed and bring with it “new” and updated numbers.

I need to see the old numbers so I can see where things have changed.

So what I’m hoping for is a script that I can scan the manager backup and it pull whatever versioning may exist that will tell me what version I used to make it. (Yes, for the last few months I have added the manager version number to my backup file, but I never did that in the past).

@lubos, I’m hoping you can provide a tool or suitable script or header value to look for?

3 Likes

I use linux and OSX, on both I have the command line utility for sqlite3, I’m sure windows probably has something. I created a bash script that allows me to pass in numerous manager databases and it pulls out the schema version.

The command line is simply:

sqlite3 "$file" "select hex(Content) from Objects Where Key = 'a9a71e47-82b3-49db-8aec-898adb460a80'"

where $file is the filename you want to inspect. If you have special characters in the name (like spaces and or parenthesis) make sure to enclose it in double quotes to avoid errors.

I am not sure if the UUID is the same for everyone, I assume it is, but it it’s not, it’s not too hard to find.

The query will result in 6 hex characters on the display, it appears to me as 08F201. You will find the middle byte (F2) is the schema version (0xF2 = 242) which is the current version I am running on in 20951

@d3mad you are correct. UUID is same for everyone and schema version is currently at 242. Eventually it will be possible to rollback even after upgrading to new schema version since History tab contains enough information to make rollback.