VVV 2

VVV 2

What is VVV? What's new in VVV 2? How to Migrate from v1

Eba4cc68bfbc2b59c3c3a3cf789075f0?s=128

Tom J Nowell

April 03, 2017
Tweet

Transcript

  1. __ ___ ___ __ ____ \ \ / \ \

    / \ \ / / |___ \ \ \ / / \ \ / / \ \ / / __) | \ V / \ V / \ V / / __/ \_/ \_/ \_/ |_____| Varying Vagrant Vagrants Tom J Nowell @tarendai https://tomjn.com
  2. This Talk Covers • What is VVV • What Changed

    in VVV 2 • Migrating from VVV 1 • Setting up a new Site • Setting up an existing site
  3. What is VVV?

  4. A Local Developer Environment • WP CLI • PHP •

    MariaDB • MemcacheD • Nginx • Site Provisioning • A standardised system
  5. Installation From scratch • Install Vagrant & Virtualbox & git

    • Grab a copy of VVV from GitHub • Run: vagrant plugin install vagrant-triggers vagrant-hostsupdater Then: vagrant up --provision
  6. None
  7. vagrant up Turns it on vagrant halt Turns it off

  8. What Changed in VVV 2?

  9. vvv-config.yml

  10. Sites: # The wordpress-default configuration provides a default installation of

    the # latest version of WordPress. wordpress-default: repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git hosts: - local.wordpress.dev # The wordpress-develop configuration is useful for contributing to WordPress. wordpress-develop: repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-develop.git hosts: - src.wordpress-develop.dev - build.wordpress-develop.dev #example-site: # repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git # hosts: # - my-example-site.dev utilities: core: - memcached-admin - opcache-status - phpmyadmin - webgrind
  11. Important: Copy to vvv-custom.yml

  12. Migrating from VVV 1

  13. Backup your database Already done if you have vagrant-triggers

  14. Rebuild: vagrant destroy Vagrant up --provision

  15. Migrating a VVV 1 Site

  16. None
  17. sites: vvv1site: hosts: - vvv1site.dev

  18. Always reprovision on changes vagrant reload --provision

  19. Setting Up a New Site

  20. Add a site to vvv-custom.yml: newsite: repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-t emplate.git hosts:

    - newsite.com
  21. sites: wordpress-default: repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git hosts: - local.wordpress.dev wordpress-develop: repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-develop.git

    hosts: - src.wordpress-develop.dev - build.wordpress-develop.dev newsite: repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git hosts: - newsite.com utilities: core: - memcached-admin - opcache-status - phpmyadmin - webgrind
  22. Always reprovision on changes vagrant reload --provision

  23. Setting Up An Existing Site

  24. Add a site to vvv-custom.yml: site-name: repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-t emplate.git hosts:

    - example.com
  25. 1. Reprovision 2. Copy files 3. Copy Database

  26. Always reprovision on changes vagrant reload --provision

  27. Advanced Provisioning

  28. provision/vvv-init.sh A bash script that sets up your site provision/vvv-nginx.conf

    The NGINX config for your site
  29. More Per Site Options skip_provisioning: true branch: develop

  30. Custom Folders local_dir: <absolute path> vm_dir: <absolute path>

  31. example-site: local_dir: /home/user/Documents/example vm_dir: /srv/www/examplesite hosts: - my-example-site.dev

  32. sites: # The wordpress-default configuration provides a default installation of

    the # latest version of WordPress. wordpress-default: repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git hosts: - local.wordpress.dev example-site: repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git local_dir: /home/user/Documents/example vm_dir: /srv/www/examplesite hosts: - my-example-site.dev utilities: core: - memcached-admin - opcache-status - phpmyadmin - webgrind
  33. Custom PHP Versions nginx_upstream: php56

  34. sites: # The wordpress-default configuration provides a default installation of

    the # latest version of WordPress. wordpress-default: repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git nginx_upstream: php70 hosts: - local.wordpress.dev example-site: repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git nginx_upstream: php56 hosts: - my-example-site.dev utilities: core: - memcached-admin - opcache-status - phpmyadmin - webgrind - php56
  35. Common Troubleshooting Local Network Clashes VVV using the same IP

    as other computers Typos in vvv-custom.yml Syntax errors will break provisioning Corrupt VMs Powering down a machine unsafely, or disk corruption Out of Date Software Old Vagrant and Virtualbox Downgrading to VVV 1 Downgrading isn’t supported
  36. Database Backups Vagrant triggers runs a backup script on halt/destroy

    that places SQL files in database/backups/*.sql Backups are restored on provision if the db is empty
  37. More Info https://github.com/Varying-Vagrant-Vagrants https://varyingvagrantvagrants.org

  38. Tom J Nowell VIP Wrangler at Automattic https://tomjn.com @tarendai

  39. Q? Tom J Nowell @tarendai https://tomjn.com