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

Bervetuna's avatar

Upgrade Laravel 8 --> 9 on shared hosting

I would like to upgrade a Laravel 8 project that is hosted on a shared hosting server to Laravel 9.

What is the best way to do this?

  1. I have SSH access. So, I can make the necessary changes in the composer.json file and update it using the 'composer update' command. The content of the public folder has been moved to public_html. Will a new public folder be created during the update in the app directory? And should I then move the contents of that new public folder back to public_html, replacing the current files?

What about the storage folder, which already contains a lot of content? Will it be retained as is? Do I need to recreate the link?

  1. I could do the upgrade locally and then deploy the entire project back to the shared hosting. I assume that I shouldn't upload the storage folder in that case, or else I will lose what's already in the storage folder?

  2. I could do the upgrade locally and then upload only the necessary folders to the shared hosting via FTP. But which folders are those?

Thanks for sharing your experiences with this!

0 likes
3 replies
jlrdw's avatar

Upgrade laravel locally and ftp up, and upgrade the framework via ssh. Or do all locally and re ftp up. Just delete the vendor folder on the host first.

jlrdw's avatar

@Bervetuna Up to you, I generally use a tool that I can just upload changed files (Winmerge). But either way will work.

Make sure it's all working on local first.

I suggest a new ver 10, copy M-V-C over instead of upgrading.

Please or to participate in this conversation.