I have a little "big problem" I've written a Laravel project that's running in prod on version 8. I see now v.12 is out for some time.
Please, could you share how would you takle the upgrade to the latest version? Would you be able to share some insights, docs, or guidelines on how to do that please?
@tnort I try to make the upgrades as soon as a new version is released, that way the changes are kept to a minimum, and make sure that I have tests for everything to rely on.
If I would manually go from version 8 to 12, I would go with the same approach as @jlrdw suggested.
If you don't use shift, look at the Laravel documentation. It has an upgrade guide which is easy to follow for each version upgrade. Take them one at a time until you get to the latest version. It's best not to skip any
@Ben Taylor, thanks. I had a look earlier at it but seems like a big shift from v8 to v12. Have you done that before? What problems have you encountered?
@tnort all my upgrades are manual as I'm too cheap to pay for shift :)
I haven't had any issues really as the guides are quite clear. Just don't miss anything.
I have done what @jlrdw suggests in the past too and agree that sometimes that is the best way to go. Especially if you need to move from Mix to Vite, or want to use Inertia with SSR. Can be useful to have all that stuff setup for you out of the box rather than trying to add it in yourself.
@Ben Taylor I agree with this - we've found upgrading all the way from 4.2 to L10 was, whilst a stressful process, we had a lot more control over the upgrades. Especially when using GIT, so @tnort if you're upgrading and comfortable with doing it manually then I'd do that. I think it really depends on experience, confidence and how the app is setup.
Upgrading each little step as and when we needed to, I recorded the time it took and each version just got quicker and quicker as the changes were easier to manage and also understand rather than just a straight switch to the most recent version.
The change logs are pretty thorough and easy to follow.
To add, sometimes I will just start a new app and migrate my models, views, controllers. and custom classes over to the new app. Many times this is simpler.
But still read the various upgrade guides to see the changes.
@jlrdw, that seems like a lot of work and on the top of that it can be error prone. It's super easy to miss something that can not only lead to bugs but also security breaches.
It's usually easier to start a new app and migrate models, views, controllers and custom classes over.
But of course read all upgrade guides to view changes.
@tisuchi, yeah one step at a time. Seems like in my case I would want to switch to Vite too so probably creating a new app would be the smart choice here.