Eventually, VB6 developers must migrate to Visual Basic .NET and the .NET Framework. With the ever changing technology organizations are compelled to adapt VB.NET, which is a mix of best in class features of various development languages and platforms. Powered by C++ and a rich set of SDK developer tools, VB6 functionality is enhanced when migrated to .NET framework. Previously, moving from VB6 to newer version of VB was backward-compatible requiring minimum changes to build and run the code. This backward compatibility is not of great importance for the new .NET environment and will require a substantial amount of effort to migrate from VB6 to VB.NET.
A successful migration process will always depend on the following:
1. Migration Strategy – Updating an application can be strategically judged by considering the options for upgrading, reusing, rewriting, or replacing the application.
- Upgrade by applying upgrade process and adding business functions. This process saves a lot on investment as you can carry forward a lot of the code and business logic used previously. It is applicable only if there are very few changes in the existing application.
- Reuse the application by adding an additional layer to interact with the .NET system. Reuse is recommended only if the operational cost of existing application is low and business rules are satisfactory.
- Rewrite is possible when the application no longer serves the business needs and the time and cost of rewriting the application is acceptable. When rewriting the application from scratch, the entire application can be redesigned with latest .NET technology.
- Replace the existing application with a suitable off-the-shelf solution. Existing business model will have to be updated half-way to incorporate the new changes. There may be a disruption in service and chances are that the replaced application may not exactly suite the requirements.
2. Preparing for the Migration – Development environment will have to be set right before preparing the source code. Visual Studio 6 is needed to prepare VB6 code for the upgrade. VB.NET is the developer environment needed to run the upgrade wizard. While applying the upgrade wizard the accuracy of conversion depends on:
- Quality of Code – It is a known fact that well-written code always converts easily. So, during conversion, the primary task should be to clean the original code and simplify it. A detailed checklist can be maintained to make the conversion process easier. Ensure that all variables are declared as explicit types, remove any dead codes, compile and run before conversion. Perform as many trials runs as possible to rectify any issues before the final conversion.
- Conversion of VB6 and ActiveX Controls – Majority of the VB6 controls will be upgraded by the Upgrade wizard, but complex components and ActiveX controls are converted to .NET using wrappers. Control arrays is another feature missing in .NET, which is fixed using the upgrade wizard classes. VB6 codes can be checked using a free Microsoft downloader tool CodeAdvisor.
3. Testing the upgraded application – To ensure the application still has expected behavior after migration, it is essential to perform testing. Type of testing required may vary based on each of the upgrade strategies. If the codes are automatically updated using upgrade wizard then the focus is on testing the fixes of the errors, warnings, and issues (EWI’s). White box testing includes testing individual components by providing unit testing and profiling the upgraded application. Black box testing uses the upgraded application to simulate client/user experience and check the response of the upgraded application. Testing can be performed at the end of the upgrade or in iterative stages based on the complexity of the application to eliminate bugs and fix any issues.
4. Deploying the application – Deploying the .NET application includes installing the application and running it on the client server. Dependencies will have to be addressed and deployment will be carried out using assemblies like executables or dynamic liked libraries. Versioning in assemblies facilitates in installing multiple versions of .NET application running on the same computer. It is also easy to update deployment with service packs or application updates. Different types of installers can be built for various applications as .NET supports inbuilt templates.
5. Improving the upgraded application – Including additional features to improve the upgraded application indicates organizing the code and considering which portion of the system to be reused. Advancing the application is not a simple process and will depend on the extent or complexity of the feature. There may be a need to modify the architecture, do a redesign or simply refactor the code base to add on the additional functionality. As architecture and redesign changes will impact the overall system, one needs to consider how it can be implemented without any downtime or affecting the business.
It is always important to understand the benefits of upgrading from VB6 to .NET before investing time, manpower and money into it. By carefully embracing the above five steps companies can leverage seamless migration and tap on the benefits of the .NET framework. At Macrosoft we deploy a custom delivery model that best fits your business migration goals. A highly specialized team of developers both in VB6 and VB.NET will guide you through the entire migration process and ensure that the upgraded application is as per your expectation.