1

I have done a ton of research and haven't found anything that has helped me decide what will be the best route (vertical slicing, horizontal slicing, or just a complete rewrite). I am working on a very LARGE program that is very ugly with no comments and need to migrate it over to Angular 8 if possible or at least up to Angular 7. A lot seem to recommend https://angular.io/guide/upgrade however, they don't help too much in migrating to 1.5 first. Does anybody have experience with a large scale migration? Currently, the program is not being used so downtime is no issue.

CluckHeads
  • 37
  • 6
  • 1
    Better rewrite everything from scratch. Especially on larger projects. I tried several ports and none of them worked 100%. – Ling Vu Jan 07 '20 at 15:02
  • Thank you!! If you can help me gain a better understanding really quick, in a rewrite I don't need to change much in the HTML, rather I need to create all .ts files instead of .js and convert everything to components and the new routing class by class. In the end there should be just about the same amount of .ts as there was .js. Any help is very appreciated, this has been killing me! thank you again – CluckHeads Jan 07 '20 at 15:09
  • Try to rewrite it one module at a time... Start for the simple ones and then scale up to the modules that depend on those. – maury844 Jan 07 '20 at 15:22
  • So basically one web page at a time? like the login screen, then the main screen that the login screen will take you to and branch out from there or am I not looking at this correctly? This is my first javascript project and its huge with no comments making it tough to tell what is actually going on behind the scenes. – CluckHeads Jan 07 '20 at 15:25
  • @CluckHeads if you haven't really worked with JS before i think this may be a huge task. I would recommend firstly learning at minimum how AngularJS and Angular 2+ work so you can understand the code. After that i would agree with others, rewrite it as that will cause the least amount of pain. Going hybrid is a pain and full of bugs and workarounds making for horrible code. – Chirag Patel Jan 07 '20 at 16:05
  • Thank you, I have some understanding of AngularJS but very little on Angular 2+. I have four months to complete this with my partner. Any good guides on learning Angular 2+? I am currently starting this [link](https://www.c-sharpcorner.com/article/learn-angular-8-step-by-step-in-10-days-day-1/) Thank you for the honesty and help Chirag, very appreciated!! – CluckHeads Jan 07 '20 at 16:23
  • I would rewrite it and run a hybrid app in the meantime. That's why there's `ngUpgrade` library to help in such case. – Robert Koritnik Jan 07 '20 at 17:58

1 Answers1

0

It doesn't seem like it at first, but a re-write is usually a more cost effective solution than an upgrade. It seems like upgrade would be the fastest time to re-deployment but in my experience if you did the two side-by-side you might find the times similar, except that the migration deployment will have to be all or nothing, where as a re-write means you can deploy with reduced functionality and build up the feature.

More importantly, the on-going maintenance of an upgraded site becomes exponentially harder/time consuming. You're really applying band-aides over the top of previous patches and fixes.

There are new concepts, better native support for directives and controls that we used to use 3rd parties for or roll own own, and it's an entirely new language to understand. Take this opportunity to wipe the slate clean of your solution's technical debt.

Rewrite - Hybrid

Do you need to deploy eveything in one go? Are you interested in Re-Branding?
One thing the Microsoft have done well in the past is the hybrid roll-out of their Preview portals.

The best case study IMO is the Azure Portal.

A few years ago we had a pretty fully featured portal interface for managing Azure assets. This would later become known as the Classic Portal when they started work on an entirely new user experience. At first release the menu system was largely complete, we could navigate most assets in the new portal but when you came to features that had not been redesigned yet the link took you back to the Classic Portal.

So you could do the same, have the two user interfaces deployed to different URLs, start by making sure the authentication and navigation is largely complete but make all links take the user back to the original interface. Then feature by feature, implement the new interface, but because you can't control everything, keep a button or link on each page that takes the user back to the original implementation until your regression testing confirms that you have reached feature parity.

That is another key take-away from the MS Hybrid approach, significant change like this WILL annoy your users. So while you are in transition, allow the user to choose when they themselves migrate over. Initially MS achieved this at login, the user could login at either of the main urls, and based on your profile you would be redirected to the portal of your choice.

The last step is to restrict access to features in the old interface, by making the navigation and links in the old portal navigate directly into the new interface. - or less intrusive, add an 'end of life' banner in each page that you have compelted the re-write on in the old site.

Do not confuse this with the Preview Mode in Office 365, the Azure Preview Portal was a ground-up re-write and is still in progress. There are many licensing operations that I still use the Classic Portal for as I still manage some Classic Only azure assets that have not yet been re-deployed.

I would consider the following issues when choosing between Migration/Upgrade and a straight up re-write:

  • Migrate to AngularJS 1.5 first
    This operation is only marginally easier than the upgrade to Angular2+. All of the arguments below apply equally to this process as they do the next upgrade. One of the reasons to goto 1.5 first is to escape the legacy dependencies that do not have a simple direct upgrade to 2+.

    • During the upgrade to 1.5 you should consider implementing Component based architecture (if the current code does not already do so)
      A key element of components is less configuration and simplifed design, so read this as less to upgrade, less that can go wrong

      Components are of course more closely aligned with current Angular implementations, if you do not yet use AngularJS Components, that might be a good iterim step to understand before learning Angular 2+

  • No Comments
    This is a bigger red flag than you think. If the code base is not documented then any sort of maintenance becomes incrementally harder as each time the code must be re-read and re-interpreted before you can affect change.
    So if a migration is on the cards, where talking about every line of code at some point needed to be re-read and understood to make sure that it works correctly in the

  • AngularJS 1+ => Angular2+
    While some of the core frameworks and 3rd party libraries can be migrated, most controller javascript files cannot be simply migrated to typescript without a fair amount of effort. It's pretty common in javascript to cut a lot of corners in terms of type definitions and locations of definitions that mean after migration you will spend a lot of time going back through most javascript files one method at a time.

  • Very large
    This is a strong candidate for automation or migration but ultimately it means that the total surface area to test, debug and re-design is also very-large. If the initial migration does not compile, it could be a long road of tweaking before you can get the user interface up so you can start interface testing.

Chris Schaller
  • 13,704
  • 3
  • 43
  • 81