Sync Varying Vagrant Vagrants environments between machines.
-
Follow the installation instructions on VVV.
-
Add the following directly below
if defined? VagrantPlugins::Triggers
:config.trigger.after :up, :stdout => true do info "Importing databases..." run_remote "bash /srv/database/sync-sql.sh" end
Look at
Vagrantfile-example
for an example. -
Copy
config/homebin/vagrant_halt_custom
,database/sync-sql.sh
, andprovision/provision-post.sh
to their corresponding directories. -
If using Resilio Sync, add the following to
.sync/IgnoreList
:# Vagrant .vagrant .debris # Development node_modules bower_components
-
vagrant up --provision
-
Halt the 1st machine then repeat steps on 2nd machine
- Machine 1 (with vagrant running) - run
vagrant halt
- Machine 2 - run
vagrant up
- this will import the db's that are synced. (Note: If you've added a new site, make sure you run vagrant up --provision on the other machine.)