VB6 to .NET Migration in 10 Steps

VB6 to .NET Migration in 10 Steps

By Nellaiappan L | March 24th, 2021 |

Essential Steps in VB6 Migration

Converting VB6 code to VB.NET is not a simple process that can be executed easily even when using automation tools. Several automation utilities are available in the market, with Microsoft itself being shipped with a Visual Basic Upgrade Wizard. One of the major changes in VB6 is in the Common Language Runtime (CLR) a new programming model. To reap the maximum benefit out of the new features and structures of VB.NET, it is advisable to rewrite major sections of the application rather than simply using an automated migration process. Since this is a tedious process you can use VB.NET’s Upgrade Wizard that automatically converts the syntaxes, which helps getting the initial work done. But after using the Wizard you will be faced with other problems and errors during compilation.  These are fully handled properly by the Wizard. During migration, you will have to rewrite and rearchitect the codes to take maximum advantage of VB.NET’s new tools and capabilities.

.NET migration is a complex process that requires strict adherence to the features and syntactical aspects of the programming language. Here are some of the essential steps that need to be considered while migrating from VB6 to VB.NET.

Why is it Inevitable to Migrate your Visual Basic Application?

  • Application Assessment

Perform a thorough assessment of the application to be upgraded. You can manually document the existing system functionalities, though it may be a tedious process. Use an assessment tool to analyze the VB6 application to understand issues and estimate the approximate cost and effort. The tools are helpful in generating reports from which the migrations team can be provided an idea about the future actions that will be required during the full migrations project. The tools can help predict where the team will need to code new libraries, new functionalities, and more.

  • Planning and Preparation

Prepare a project plan, determine scope and migration requirements by revealing the maximum information about both the legacy and new application. Create functional requirements for the new framework and application. Get all the tools, assemble a team, and ensure everyone is working together towards a common set of deliverables.

  • Upgrade Strategies

Develop a migration strategy after brainstorming and documenting the application requirements. First, you need to get the VB6 application into the new .NET platform with the existing functionality. Then perform incremental changes to incorporate new functions and features. There are several ways to approach the migration, and more than one of them may be used in various forms within the various stages of your migration project. It is better to plan ahead but also remain flexible enough to address the ever-changing needs of the business.

  • Automatic Upgrade

After running an automated migration, the quality of the generated code needs to be improved. This involves removing duplicated code, upgrading problematic syntax and controls, and fixing data declarations. The automation process produces a code with the same code quality as the previous code. Automated changes are often cosmetic, and the changes may also be incomplete requiring manual intervention.

  • Manual Upgrade

It is essential to rewrite critical application logic to fit the .NET framework and those that have not been properly converted during automation. One approach is you can continue writing new code in VB.NET leaving the bulk of the existing code in VB6 as there is good interoperability between VB6 COM components and VB.NET components.

  • Migrate Data

This involves creating a SQL Server or database and importing data and resizing the database structure. Normalization and optimization of the data ensures better performance.

  • Compiling

Compiling the project provides a list of compilation and runtime errors that will need to be analyzed and fixed by your team following an iterative process.

  • Fixing Errors

Bugs can be tracked using various source code analyzers that helps identify duplicate codes and fix data declarations. Bug fixing and development needs to happen at arm’s length as new codes are converted. Testing needs to be done and passed by a separate group then those who did the development.

  • Quality Assurance

Upgraded applications will be subjected to different levels of testing throughout the process. This ensures the reliability and correctness of the application. The quality assurance activities will be parallel to development.

  • Unit test thoroughly each item converted to help identify any flaws in implementation.
  • Perform system testing to ensure the application functionalities are met in the .NET framework version.
  • Import final version legacy data and perform load testing to ensure the application works in the .NET environment.
  • Deployment

Finally deploy to the application server and verify the checklist of all the components and functionalities in the application tally.

Why is it Inevitable to Migrate your Visual Basic Application?

Another aspect that developers should keep in mind during VB6 to .NET migration, is the difference in the procedure by which objects are cleared from memory. In VB6, object instances are cleared using COM reference counting mechanism. While in VB.NET, the job of clearing unreferenced objects is done by garbage collector. Garbage collection helps in establishing a compact memory in use. Developers utilize the method Collect in GC class to perform garbage collection. However, calling the garbage collector explicitly leads to suspension of all threads before triggering the garbage collection that lead to performance issues. So the implicit method invoke is always recommended.

Migrating VB6 to .NET is definitely the way to go with rapidly changing programming landscape. Migration puts forth some challenges that can be overcome with automation tools, source code analyzers and proper planning by only upgrading sections relevant from a business point of view. Here at Macrosoft we have a proven track record of successfully migrating business-critical applications, which are executed by a dedicated team of developers experienced in both VB6 and VB.NET environments.

For more information related to .NET migration and services, continue reading our blogs.

Nellaiappan L on Linkedin
Nellaiappan L
Application Delivery Manager at Macrosoft Inc
Nellaiappan is the Application Delivery Manager for Macrosoft's .NET migration team. Subsequently, Nellai leads the Migration Service to migrate client legacy systems to the latest technologies such as .NET. As a PMP certified professional, he has received accolades from clients for his efficient leadership. Incidentally, during his first migration project, Nellai accelerated the migration resulting in a new service offering from Macrosoft. Later, Nellai worked on an array of proprietary migration tools that form the backbone of the Migrations Practice at Macrosoft.
Recent Blogs

How to Virtualize your VFP Application
How to Virtualize your VFP Application
Read Blog
How To Convert Visual FoxPro to .NET
How To Convert Visual FoxPro to .NET
Read Blog
The Strategies for Converting Large, Tightly Integrated VFP Legacy Systems
The Strategies for Converting Large, Tightly Integrated VFP Legacy Systems
Read Blog
Visual FoxPro in 2019
Visual FoxPro in 2019
Read Blog
6 Factors to Consider When Deciding Between A Migration or An Off The Shelve Solution
6 Factors to Consider When Deciding Between A Migration or An Off The Shelve Solution
Read Blog

Copyright © 2021 Macrosoft Inc