moodle-hat icon indicating copy to clipboard operation
moodle-hat copied to clipboard

Drop any existing moodle database on a fresh provision

Open kwiliarty opened this issue 10 years ago • 6 comments

When we re-provision an existing machine, I think we need to drop any existing databases, especially but not only if we are planning to use #12.

kwiliarty avatar Oct 16 '15 14:10 kwiliarty

I'm not sure I'd expect that, as a user. In particular, it's necessary to provision a VM when resuming from halt. I wouldn't want the database destroyed in that situation.

mackensen avatar Feb 27 '16 19:02 mackensen

I think when you resume from a halt it only provisions steps that are marked to provision each time. For me most provisioning steps only run when I call vagrant provision (against a running machine) or vagrant up --provision on a halted machine. Is that not what you experience?

kwiliarty avatar Feb 27 '16 20:02 kwiliarty

Here's what I get when I vagrant up on a halted machine

==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.

And everything is just as I left it.

kwiliarty avatar Feb 27 '16 20:02 kwiliarty

The sync folder is mounted? That hasn't been my experience.

mackensen avatar Feb 27 '16 20:02 mackensen

I believe that it ought to be mounted, but there are problems when Vagrant and VirtualBox guest additions aren't matching up. I started using the vagrant-vbguest plugin and my sync folders are always mounted correctly. Sometimes the first provision takes longer, but in general it feels more stable to me. I read about it at http://kvz.io/blog/2013/01/16/vagrant-tip-keep-virtualbox-guest-additions-in-sync/ . At any rate, you shouldn't have to reprovision to get your sync folder back.

kwiliarty avatar Feb 27 '16 22:02 kwiliarty

I think a reasonable approach might be to detect if the database is present and to reinstall if not. You'd still need to drop the database manually.

mackensen avatar Mar 04 '16 16:03 mackensen