Case Study: Modernization of an outdated IT solution

16.03.2025
codeart
Case Study: Modernization of an outdated IT solution

Our client was using an IT solution built on outdated technologies, Web2py and Python 2.7. This situation presented a significant challenge for expanding features, maintaining, addressing security risks, and scaling. We faced the challenge of ensuring backward compatibility of the existing code while migrating to newer versions of Web2py and Python 3. To take advantage of modern tools used for development, testing, deployment, and maintenance, we had to modernize the system. We decided to move the infrastructure to the cloud to make processes more flexible and reduce maintenance costs.

Main objectives of the project

  • Migrate to supported technologies – transition the code to Python 3 and update Web2py without disrupting existing functionality.
  • Automate development and testing – simplify deployment processes and improve software quality.
  • Move the infrastructure to the cloud – ensure scalability and optimize operational costs.
  • Improve system stability and performance – eliminate bottlenecks in the code and optimize operation.

How We Proceeded

1. Challenge: Outdated technologies and the need for migration

The existing solution was originally written in Python 2.7 and ran on an older version of Web2py. Since Python 2.7 no longer had official support, migrating to Python 3 became essential. However, this step was not simple because:

  • A significant amount of code used incompatible libraries that did not work with Python 3.
  • Some custom modules and functions in Web2py relied on deprecated syntax elements.
  • Rewriting the entire system was neither time- nor cost-effective, so we needed to find a way to maintain backward compatibility while modernizing the application.

More about the topic also in our blog: Software modernization: When should you replace an old system?.

2. Infrastructure and process analysis

After identifying issues in the code, we also examined the overall infrastructure and development processes. We uncovered additional challenges:

  • The absence of automated testing and deployment meant frequent manual interventions.
  • The monolithic solution had poorly defined responsibilities, didn’t follow SOLID principles, which led to error-proneness and made scaling and developing new features difficult.
  • Servers were managed manually, which increased operational costs and the risk of downtime.

3. Code adjustment for Python 3 and migration to a newer Web2py

We divided the migration into four phases:

  1. Code Analysis – Using automated tools, we identified incompatible parts and potential issues.
  2. Testing – We introduced automated tests to ensure the changes wouldn’t cause unexpected errors in the application.
  3. Gradual Refactoring of the Code – We rewrote incompatible parts to make them work with Python 3 while preserving the original logic of the application. Automated tests prepared in the previous step helped us here.
  4. Updating Web2py – To ensure stability, we updated Web2py in steps, testing functionality, and fixing issues as we went.

4. Containerization and migration to the cloud

Since we needed to test the system and prepare development environments, we decided to move it from physical servers to the cloud (Azure). Before migrating, we:

  • Deployed Docker and Kubernetes to easily scale the application.
  • Transformed the monolithic architecture, breaking down the existing solution by services and creating containers for cloud deployment.
  • Optimized database operations, speeding up system responses.

5. Implementation of CI/CD and automated testing

To make development more efficient, we implemented automated CI/CD pipelines:

  • Automated testing using Selenium.
  • Automated deployment to production through GitLab CI.
  • Security and performance tests to check the stability of the application.

6. Monitoring and support

After migrating to the cloud, we implemented a monitoring system (Zabbix) to provide:

  • Continuous oversight of application performance.
  • Automated incident alerts.
  • Data for optimizing operations.

Results achieved

  • The system is fully compatible with Python 3 and the latest Web2py.
  • The modernized code allows for easier maintenance and expansion of the application.
  • Development has accelerated by about 40% thanks to automated tests and CI/CD.
  • The migration to the cloud resulted in cost savings on infrastructure.
  • Monitoring significantly reduced downtime and allowed for faster responses to incidents.

What’s next?

This project was a significant step forward and prepared the company for future challenges. Moving forward, we recommend:

  • Continuing to optimize the application and expand its functionality.
  • Investing in further automation, particularly in testing and security.
  • Fully leveraging cloud services and exploring additional cost optimization opportunities.

The project demonstrated that modernizing an outdated solution is possible without the need for a complete rewrite. Thanks to a thoughtful approach and incremental steps, we managed to maintain stability, preserve backward compatibility, and prepare the system for the future.