VistaDB DataBuilder 4 has a new menu option to allow upgrading VDB3 files to the newer VDB4 format. There is no need to use a separate Data Migration to step up from VistaDB 3 to 4.
This upgrade process does not modify the current vdb3 file in any way, a new database is created with the vdb4 extension in the same path as the existing database. This allows you to continue using the vdb3 file side by side, or to test functionality in both engines (yes you can have VistaDB 3 and 4 on the same machine side by side).
What about your customers?
Your users of course will also have to update their database when you push the new engine to them. You can use the PackDatabase call in the VistaDB 4 database engine to handle the complete conversion for your users without having to ship a separate upgrade utility (unless you want to ship one).
Upgrade Procedure from 3.x to 4
- First make a database backup (good first step always)
- Call the PackDatabase method on the database and make sure you catch any errors
- If errors occur you may need to repair database (drops constraints, indexes, etc)
- Rename the database to vdb4 to ensure you know it is the new format and prevent any older copies of the engine from loading it (even if you have renamed the database changing the extension would be a good idea to prevent your older installs from attempting to load the new database format)
Regression Tests are a Good Thing!
Late in my testing Friday I found a bug in the upgrade from 3.x to 4 logic. It was specific to the vdb3 internal file version, but I couldn’t determine why it was happening.
As a part of our test suites we have historical problematic databases from customers stored for regression testing. I decided to upsize all of them to vdb4 and ensure they all worked correctly in the new engine. When I upsized them two of them they upsized fine, but their unit tests then failed… hmm, definitely not good.
I spent all Friday evening working through the issue. The vdb3 files would convert, but why did their tests fail? I assumed it was an engine regression and started attacking it from that angle first.
Assumptions… well, you know what that means
Turned out the logic for all these tests was correct if I generated a new database, but the existing customer databases would not work. So that meant it had to be in the upsize of the file itself. About midnight Friday night I called it a day and went home.
I came back in this afternoon and started working on the issue from the upsizing system. It turns out that some very specific file schema changes were implemented between 3.0 beta and 3.0 final that were not documented and didn’t change the revision of the file format. That is ok since it was during beta, but it caused me a lot of difficulty tracking this down.
Very version specific
If you were running a File Version 3 or lower (pre 3.0 release) you would end up with a file format change that the engine thought had already been performed, but was not performed correctly in the schema. That left the database in a bad state, but the upsizer thought it had good data to convert.
I think I have the issue completely solved now, but I ended up touching some engine internal routines to be a little more paranoid during their loading of the schema during a pack or repair operation. Any low level changes like that make me more than a little nervous, so I want to wait and look at the complete test suite again on Monday (I am taking tomorrow off, sorry). Once we all have a chance to look at it on Monday and ensure I didn’t make a simple one line code error we should be ready for VistaDB 4.0 Preview 1.
More tests running
Now I want to go back through all the databases we have in our system and ensure they all convert. I have an upsizer running pack on every vdb3 database from our support archives right now. It is going to take a while. :) Hopefully by the time I get in Monday they will either have all passed, or I will have some interesting logs to review.
Sorry for the delay, but I would really feel better to have a second set of eyes review the code before it goes out to users.