Skip to content
ERP Upgrade

How to Manage Version Control for Custom Code During ERP Upgrades

Learn how to secure custom ERP code during upgrades using Git, dependency mapping, and automated testing to prevent data loss and operational downtime.

9 min readSysGenPro Editorial
How to Manage Version Control for Custom Code During ERP Upgrades

How to Manage Version Control for Custom Code During ERP Upgrades

Managing version control for custom code during ERP upgrades requires a disciplined approach to source code management, dependency mapping, and automated testing. The primary goal is to isolate custom logic from core vendor updates, ensuring that business-critical processes remain stable while the underlying platform evolves. Without rigorous version control, organizations face significant risks of broken integrations, data corruption, and prolonged downtime. The recommended approach involves establishing a dedicated Git repository for all custom modules, implementing a strict branching strategy, and creating a comprehensive dependency map that links custom code to specific ERP core objects. This foundation allows teams to identify compatibility issues early, refactor deprecated code proactively, and execute a controlled cutover with a verified rollback plan.

Preparation: Auditing the Current Codebase

Before initiating any upgrade, the first step is a comprehensive audit of the existing custom code. Many organizations accumulate technical debt over years of incremental changes, leading to undocumented dependencies and fragile code structures. The audit should identify all custom modules, scripts, and API endpoints that interact with the ERP core. Each component must be cataloged with its purpose, owner, and last modification date. This process reveals which code is actively used, which is redundant, and which relies on deprecated vendor APIs. Teams should also assess the current state of version control. If code is stored in local directories or shared drives without a centralized repository, migrating to a robust system like Git is a prerequisite for a successful upgrade. This baseline assessment provides the data necessary to estimate the effort required for refactoring and testing.

Identifying Deprecated Dependencies

A critical part of the audit is identifying dependencies on vendor features that are scheduled for removal or modification in the target version. ERP vendors frequently change internal APIs, database schemas, and model structures between major releases. Custom code that directly accesses these internal elements is highly susceptible to breakage. Developers must cross-reference the custom code against the vendor's official release notes and migration guides for the specific source and target versions. This verification step is essential because compatibility claims cannot be assumed; they must be confirmed against the exact versions involved. Any code relying on deprecated functions should be flagged for immediate refactoring to use supported public APIs or alternative business logic.

Establishing a Robust Version Control Strategy

Once the audit is complete, the organization must establish a standardized version control workflow. Git is the industry standard for this purpose due to its distributed nature, branching capabilities, and audit trail. The repository structure should mirror the ERP module structure to simplify navigation and maintenance. A recommended branching strategy includes a main branch for production-ready code, a development branch for ongoing work, and feature branches for individual tasks. This structure ensures that changes are isolated and can be reviewed before merging. It is crucial to enforce code review processes where at least one senior developer approves changes before they are merged. This peer review helps catch potential compatibility issues and ensures that coding standards are adhered to, reducing the likelihood of introducing bugs during the upgrade process.

Tagging and Release Management

Effective release management involves tagging specific commits that correspond to deployed versions. Each tag should include metadata such as the ERP version, date of deployment, and a summary of changes. This practice creates a clear audit trail and simplifies rollback procedures. If an issue arises after an upgrade, the team can quickly identify the last known good state and revert to that tag. Additionally, tags help in tracking which version of the custom code is running in different environments, such as development, staging, and production. This consistency is vital for ensuring that the code tested in staging is identical to the code deployed in production, thereby reducing the risk of environment-specific failures.

Refactoring and Modernizing Custom Code

Refactoring is the process of restructuring existing code to improve its readability, maintainability, and compatibility without changing its external behavior. During an ERP upgrade, refactoring is often necessary to align custom code with new vendor standards and best practices. This includes replacing deprecated API calls, optimizing database queries, and improving error handling. Refactoring should be done incrementally, with each change tested thoroughly before proceeding to the next. This approach minimizes the risk of introducing new bugs and allows the team to validate the stability of the codebase at each step. It is also an opportunity to remove redundant code and consolidate similar functions, reducing the overall complexity of the system.

Automating Code Quality Checks

To maintain code quality during the refactoring process, organizations should implement automated code quality checks. Tools such as linters, static analyzers, and unit test frameworks can be integrated into the CI/CD pipeline to automatically detect syntax errors, potential bugs, and code style violations. These checks provide immediate feedback to developers, allowing them to fix issues before they are committed to the repository. Automated testing is particularly important for custom code that interacts with the ERP core, as it can simulate various scenarios and verify that the code behaves as expected. By automating these checks, the team can ensure that the codebase remains stable and compliant with best practices throughout the upgrade process.

Testing in a Representative Staging Environment

Testing is the most critical phase of the upgrade process. A representative staging environment must be created that mirrors the production environment as closely as possible. This includes the same ERP version, database schema, and configuration settings. The staging environment should be populated with a representative subset of production data to ensure that the custom code behaves correctly under realistic conditions. Testing should cover unit tests, integration tests, and end-to-end business process tests. Unit tests verify the functionality of individual components, while integration tests ensure that the custom code interacts correctly with the ERP core and other systems. End-to-end tests simulate real-world business scenarios to validate that the entire process works as expected.

Regression Testing and Defect Triage

Regression testing is essential to ensure that new changes do not break existing functionality. This involves re-running a suite of tests that cover all critical business processes. Any defects identified during testing must be triaged based on their severity and impact on business operations. Critical defects that prevent core processes from functioning must be fixed before the upgrade can proceed. Lower-severity defects may be documented and scheduled for resolution in a subsequent release. The defect triage process should be documented, with clear criteria for acceptance and rejection. This ensures that the team has a clear understanding of the remaining risks and can make informed decisions about the go/no-go criteria for the upgrade.

Cutover Planning and Execution

Cutover is the final phase where the upgraded ERP system is deployed to the production environment. A detailed cutover plan must be developed, outlining the sequence of steps, responsible parties, and timelines. The plan should include a code freeze period, during which no new changes are made to the custom code. This ensures that the codebase is stable and that any issues identified during the final testing phase can be addressed without introducing new changes. The cutover plan should also include a rollback strategy, detailing the steps to revert to the previous version if the upgrade fails. This strategy should be tested in the staging environment to ensure that it is feasible and effective.

Go/No-Go Criteria and Communication

Clear go/no-go criteria must be established before the cutover begins. These criteria should include the completion of all critical testing, the resolution of all critical defects, and the approval of the rollback plan. The decision to proceed with the cutover should be made by a cross-functional team, including IT, finance, and operations leaders. Communication is key during this phase. Stakeholders must be informed of the cutover schedule, expected downtime, and any potential impacts on business operations. A post-go-live support plan should also be in place, with a dedicated team available to address any issues that arise immediately after the upgrade.

Post-Upgrade Stabilization and Monitoring

After the upgrade is complete, the focus shifts to stabilization and monitoring. The team should closely monitor the system for any performance issues, errors, or unexpected behavior. This includes monitoring database performance, API response times, and user activity. Any issues identified during this period should be addressed promptly, with a focus on restoring stability and ensuring that business operations are not disrupted. The team should also gather feedback from users to identify any areas for improvement. This feedback can be used to refine the custom code and optimize the system for long-term performance.

Documentation and Knowledge Transfer

Documentation is a critical component of post-upgrade stabilization. All changes made to the custom code during the upgrade should be documented, including the rationale for the changes and any known limitations. This documentation should be stored in a central repository and made accessible to all relevant stakeholders. Knowledge transfer sessions should be conducted to ensure that the team is familiar with the new codebase and any changes to the ERP core. This helps to reduce the risk of future issues and ensures that the organization is well-prepared for subsequent upgrades.

Risk Mitigation and Continuous Improvement

Managing version control for custom code during ERP upgrades is an ongoing process that requires continuous improvement. Organizations should regularly review their version control practices and update them as needed to reflect changes in the ERP platform and best practices. This includes staying up-to-date with vendor releases and incorporating new features and improvements into the custom code. By adopting a proactive approach to version control, organizations can reduce the risk of upgrade failures, improve the maintainability of their custom code, and ensure the long-term success of their ERP system.

PhaseKey ActivitiesResponsible RolesKey Deliverables
PreparationCodebase audit, dependency mapping, repository setupIT Director, Lead DeveloperAudit Report, Dependency Map, Git Repository
RefactoringCode modernization, automated testing, code reviewDevelopers, QA TeamRefactored Code, Test Results, Code Review Logs
TestingStaging environment setup, regression testing, defect triageQA Team, Business AnalystsTest Plan, Defect Log, Go/No-Go Decision
CutoverCode freeze, deployment, rollback plan executionProject Manager, IT OperationsCutover Plan, Deployment Logs, Rollback Plan
StabilizationMonitoring, user feedback, documentationSupport Team, DevelopersMonitoring Reports, User Feedback, Updated Documentation
  • Establish a centralized Git repository for all custom ERP code.
  • Implement a strict branching strategy with mandatory code reviews.
  • Map all custom code dependencies to ERP core objects.
  • Refactor deprecated code to use supported public APIs.
  • Automate code quality checks and unit testing in the CI/CD pipeline.
  • Create a representative staging environment for thorough testing.
  • Define clear go/no-go criteria for the cutover phase.
  • Develop and test a comprehensive rollback plan.
  • Monitor the system closely post-upgrade for stability.
  • Document all changes and conduct knowledge transfer sessions.
Written by
SysGenPro Editorial

SysGenPro Editorial

Platform & solutions team

Practical guidance on ERP, AI automation, cloud deployment and enterprise transformation from the SysGenPro team.

Share this article

Frequently asked questions

Common questions on this topic. Talk to our team for anything specific to your business.

01What is the best version control system for ERP custom code?

Git is the most widely used and recommended version control system for ERP custom code due to its robust branching capabilities, distributed nature, and extensive community support. It allows for detailed audit trails and efficient collaboration among developers.

02How do I identify deprecated APIs before an ERP upgrade?

Review the vendor's official release notes and migration guides for the specific source and target versions. Cross-reference your custom code against these documents to identify any usage of deprecated APIs or functions.

03Should I refactor custom code before or after the upgrade?

It is generally recommended to refactor custom code before the upgrade. This allows you to address compatibility issues proactively and ensures that the code is stable and optimized for the new version.

04How does version control help with ERP rollback?

Version control provides a clear history of code changes, allowing you to quickly revert to a previous stable version if the upgrade fails. Tags and branches make it easy to identify and restore the last known good state.

05What is a code freeze in the context of ERP upgrades?

A code freeze is a period during which no new changes are made to the custom code. This ensures that the codebase is stable and that any issues identified during the final testing phase can be addressed without introducing new changes.

06How do I test custom code in a staging environment?

Set up a staging environment that mirrors the production environment, including the same ERP version and configuration. Populate it with representative data and run unit, integration, and end-to-end tests to validate the custom code.

Continue learning
View all articles
Explore the platform

Where to go next

Browse the knowledge hub

See how SysGenPro fits your business

Discuss your workflows, modules and deployment options with our team.

Back to resources