I've been asked to re-open a project I wrote in 1998/99 in Delphi 3 and which has been running stably since then. I have the Delphi 3 code base on an aging Windows 98 machine which exists only to keep this project alive. Obviously, I'd like to bring the source code base into the 21st century before undertaking any major revisions.
I note happily that Delphi 2010 (I'm currently on 2007) claims to be able to import projects from Delphi 2 on. Does anyone have any experience importing large projects from Delphi 3? Can I expect this to be an easy transition, or a difficult one?
In addition the original project makes use of third party components including DBISAM, WPTools, and TMS Planner. I note that all of these are still available for the latest release of Delphi. Assuming I first install the new versions into Delphi 2010 can I expect the parts of my application that use these components to be translated as well? I know that at least WPTools has changed some of its component structures and interfaces since the version used in the original application and obviously I'll have some recoding to do there, but will the failure of those parts of the program prevent my code base from being upgraded at all?
It should be very possible to do this migration, and depending on how your code is written, it may either be painful or painless. Unfortunately its not easy to say which until you start the migration process.
The first thing i would do would be to make sure that ALL DFM files are converted to their text representation. This I believe was set to default in later versions of Delphi but as I recall Delphi 3 used a binary format. There should be a utility file named DFMConvert or something in the delphi 3 bin directory which allows you to convert a DFM to text. The reason you will want to do this is to insure that you can read the source if you have to perform a hand edit of the DFM due to a component not loading. Not only are you jumping versions of Delphi, but you also are jumping versions of EVERY component you use and there may be a few incompatibilities that may cause a component to fail loading. I have found if this is the case and you have a "new" version, then use the edit the DFM source directly and compare a test form with the component on it against what your old version contains. Remove anything (or rename) that is out of place and then attempt to load the form again.
As Frabricio mentioned, if you use variants then you will need to make minor adjustments to your uses clause.
The good news is that your code itself should work fine once you get the components/uses clause corrected. If you go directly to Delphi 2010, your only other issue would be Unicode and the compiler does a fantastic job of pointing all of them out to you via errors and warnings.
As you have D2007 and assuming all these component sets come with D2007 dcus as well, I'll advise you to first try reopen the codebase on D2007. And after that, go to D2010 because of the Unicode feature of the actual VCL - which can create some migration problems (which I'll not discuss here because it's deeply discussed on the web and here on SO).
I'd say that because somewhere between D5 and D7 (don't record exactly) happened an unit reorganization of the rtl (with the creation of the Variants.pas unit and many OTAPI units changed names, etc). So that will be where your first problems arise. EDIT:Not only Variants got relocated, but much IDE integration stuff too - to avoid unlicensed code to get deployed. If you have some OTAPI code (for example, code that allows published properties on inherited forms), it'll need to be relocated to a package project.
As skramradt said, you may have to deal with the binary DFM thing....
After that, if all works, go to the Unicode thing. Depending on the app, it can be easy or not. For mine ones, not of great annoyance. But I know there are others facing greater problems with it than me.
Here are a few notes we made regarding upgrading to Delphi 2010
I have about 100 applications dlls and COM servers to upgrade. Probably about 12 weeks work with commissioning. Hope this helps.
Just to reassure you, I recently converted the software I am developing from Delphi 4 to Delphi 2009 to gain Unicode capabilities, and I had a number of issues, but they were all solvable within a couple of weeks.
One thing to note: If you use any 3rd party packages, make sure they have a Delphi 2010 version available that you can upgrade to before you convert. Delphi 2009 would be okay, but I would not try to use older packages in D2010.
I can't say much about migrating D3 to D2010, but I've recently migrated D6 to D2010 successfully. To begin with, what I did was to make sure that all third party components that you've used in D3 are also available in D2010. Recompile any custom built components from D6 to D2010. Loaded my D6 source code, and compile. Handle all unicode issues. Handle all the compiler errors one by one... all done in about 3 days (approx 30000 lines of code)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With