If the angular app is badly outdated, then it is very difficult to upgrade it.
This is not a problem with Angular. 'Inability to upgrade easily' is a wellknown problem with almost all of the opensource software utilities. Opensource never comes with the guarantee of extremely long term backward compatibility or upgrading by skipping major versions.
Angular 6 was released in 2018.
Many things have changed since then. Many projects on NPM have got closed down. New projects sprang up. Typescript language had changed considerably in the past 5 years. Nodejs platform went through major updates.
Angular 17 is released in Novemebr 2023.
Jumping from 6 to 17 is a very long jump. Doing it successfully requires the understanding of changes that have happended in the past 5 years not only to Angular, but also to its ecosystem (Typescript, Nodejs, RXJS, Webpack, NPM packages).
If some of the dependencies have become deprecated, then the effort of finding and testing the replacements for the dependencies will also be required.
These are my findings based on my experience of upgrading several Angular projects in the past 8 years:
1. Upgrade from Angular 12 to 17 is easy.
Typescript language, Nodejs and the general NPM dependencies for Angular did not have many breaking updates since late 2021. Angular evolved from version 12 to 17 during this period. Upgrade from Angular 12 to 17 is fairly easy, as the ecosystem had been generally stable in this period. Most of the Angular 12 projects can be directly upgraded to 17 without code changes.
2. Upgrade from Angular 2 to 11 is difficult
Between 2016 and 2021, there was a tremendous change in the ecosystem. COVID19 pandemic also caused problems to many opensource projects. Angular evolved from version 2 to 11 during this period.
Upgrading Angular from version 2 to any other version till 11 was very difficult due to the nature of changes in the ecosystem at that time.
3. Very difficult to upgrade from before 12 to 13 or above
Nodejs and Typescript have had numerous updates coinciding with the timeframe of Angular changing from 11 to 12. Upgrading Angular from any version below 12 to a version above 12 is very difficult due to this.
Recommended upgrade approach for Angular 6 to 17
Though the best practice is to do a step-by-step upgrade, one major version at a time, it can be safely avoided in many cases.
Based on my experience and consideration of the timelines of breaking changes, this 4 stage upgrade will be the easiest:
- Stage 1: Upgrade from Angular version 6 to 9
- Stage 2: Upgrade from Angular 9 to 11
- Stage 3: Upgrade from Angular 11 to 12 or 13
- Stage 4: Upgrade from Angular 12/13 to 17