Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update laravel/homestead?

I need to update laravel/homestead? It is a Vagrant box. I'm using it for my dev environment.

I remember it was a shell command but I don't remember the command and I cannot find it. Please help

like image 279
Yevgeniy Afanasyev Avatar asked Sep 14 '18 02:09

Yevgeniy Afanasyev


Video Answer


2 Answers

This is the sequence I came up with recently (Apr 2020) to upgrade my vagrant box from 9.2.x to 9.5.x

If the VM is not running first do:

vagrant up

Then go into the VM:

vagrant ssh

and back up the databases:

mysqldump -u homestead --all-databases > homestead-backup.sql

copy the resulting file to the host machine (only if the above command was not run in a mapped folder)

Close the ssh connection:

exit

then run:

vagrant box update
vagrant destroy
vagrant box prune

Answer yes to all questions. Then

git fetch
git pull origin release

Start the VM again:

vagrant up

once it's started (it will take longer this time) go into the VM:

vagrant ssh

and restore the databases (copy the backup file over from the host if it was not in the mapped folder)

mysql -u homestead < homestead-backup.sql
like image 150
tromgy Avatar answered Sep 21 '22 05:09

tromgy


Use below command

homestead update

If this doesn't work

homestead box update

If this also doesn't work at all

This command will tell you the state of all active Vagrant environments on the system for the currently logged in user.

vagrant global-status

vagrant box update "laravel/homestead"

I hope i am clear now!

like image 22
Leena Patel Avatar answered Sep 18 '22 05:09

Leena Patel