Search code examples
laravel-5vagranthomesteadvagrantfilevagrant-provision

How to stop vagrant homestead deleting my mysql database?


I am using homestead with a fresh install of laravel. If I tinker, add some users, some other database tables etc, every time I destroy the homestead instance all my data seems to be dropped as a result. I can't seem to find an answer unless I add a job to seed the database everytime I login. Many great thanks for all of your marvelous minds, mine is currently sluggish.


Solution

  • I worked out I was not using the CL properly, it is important to note the difference between vagrant halt and destroy.

    So once you build you and vagrant up for the first time. Use halt, whilst destroy, literally blasts everything out of the park.

    https://laracasts.com/discuss/channels/general-discussion/vagrant-halt-and-destroy