Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ZetecVan's avatar

Upgrading from 4.2 and Git.

I have a live website I created in Laravel 4.2. I use Git and have been pushing changes to a private Github repo. The live site is on Digital Ocean, where I also have a staging droplet, which is automatically updated when I push to Git.

It's about time I started to upgrade my site to 5.1 and am just wondering what the correct way to go about doing this is, so I can keep the commit history. (This isn't totally necessary, just a nice to have).

It it a case of:

git checkout -b laravel5-upgrade

Deleting the L4.2 directory structure (leaving the Git files/folders alone) and doing a fresh install of L5.1 and follwing the upgrade instructions here: http://laravel.com/docs/5.0/upgrade#upgrade-5.0.

and then merging back into master?

Or is it safer just to start from scrach with a totally new git repo? What is your experience of upgrading?

0 likes
4 replies
Corez64's avatar

Both methods are fine, it might be easier to start from scratch but I wouldn't have thought it would make a huge difference. If you want to keep your commit history you wouldn't loose anything by giving it a try. If it all goes completely wrong you can revert it back and try again.

ZetecVan's avatar

Thanks for the reply. I think I'm going to start from scratch and see how it goes. As you said, I can revert back if there's any problems...

helmerdavila's avatar

Dont forget packages dependencies. Some packages require laravel 5.1. In production run only composer install, not update.

Please or to participate in this conversation.