Hi everyone, I have an old app that is currently in 4.2.8 and hosted on Heroku. I plan to get it updated to 6.1 On Heroku it is on a stack that is end of life. There are some new changes required that have some new tables and relationships to be setup So far I have created a new app on Heroku and managed to backup and restore the database to the new app. I’m a bit daunted by how to upgrade my old app and point it to the new Heroku App. The app is fairly simple, mostly CRUD features for a membership application. If anyone has any thoughts or can assist I would be most grateful Regards, Dave
Doesn’t matter what you’re updating to, the procedure I follow is the same:
- Increase test coverage (measured using simplecov) as high as possible.
- Upgrade 1 minor version at a time, running/fixing the code as we go along, till we hit the desired version.
If you’d like more help, feel free to respond and we’ll work something out.
Thanks Hasan, When you say 1 minor version at a time, do you mean major (as in 4 to 5, then 6) - there are a lot of minor version Dave
Yes… do it slowly and methodically. This is how you ensure reliability.
OK thanks - I’ve actually just switched Mac’s and it has taken a lot of time to get the new machine configured and the app running. So just now the server runs and I can login to it! So all good for now, I’ll make my changes in 4.2.8 and then move forward later to upgrade the RoR version. Thanks for chipping in! Dave
Should you need assistance, this is the sort of thing that won’t take me too long to sort out, do feel free to reach out – email@example.com. Cheers! – H
I will certainly do that - thanks so much… Dave
While I agree with Hassan, I think sometimes it might make sense to do one big version jump (e.g. from Rails 4.2 to 6.1) – I only recommend this for very small applications that are a simple CRUD app.
My co-worker wrote about a couple of strategies in this article: Two Commonly Used Rails Upgrade Strategies - FastRuby.io | Rails Upgrade Service
I think dual booting could be very helpful if you decide to start upgrading one minor version at a time: Getting Ready for Rails 6.0: How to Dual Boot - FastRuby.io | Rails Upgrade Service
Hassan’s way may be thoroughly sensible - but one major version at a time has always worked for me in practice!
Getting decent test coverage is the critical part. If you can trust your tests - then it almost doesn’t matter how you go!
Thanks for the follow up help & suggestions… I decided to leave the app on 4.2.8 for the time being. This is so I can implement new features & I will go back to upgrading once this is done. regards, Dave
It does matter how you go, for the following reason.
If you upgrade from 4.2.8 to 4.2.9 and a test fails as a result, the delta of possible changes you must go through is much smaller than if you went from 4.2.9 to 6.1.4 directly. I place (perhaps too much) emphasis on reliability for a rails programmer, but I am who I am. – H