Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct way to back-up and restore vagrant box + Variable VVV

Tags:

vagrant

I have a vagrant box (ubuntu/trusty64) installed on my MacBook. I have extended this box with Variable VVV --> https://github.com/bradp/vv#os-x-installation This enables me to create fresh WordPress installs (currently I have around 10 installs).

I want to completely clear out my MacBook and install a fresh version, but I don't want to lose my box and all of my projects. How can I tackle this problem without losing my projects?

like image 848
Bram Huisman Avatar asked Feb 05 '23 16:02

Bram Huisman


1 Answers

You can package your working VM into a new vagrant box

vagrant package --output ./new-box-name.box

and then backup this box

After you reinstall your Mackbook, you can then add this box to your local vagrant directory

vagrant box add new-box-name ./new-box-name.box

After that you initiate the vagrantfile through

vagrant init mynewbox

You will get back the same VM as what you have before

like image 156
ArrH Avatar answered May 21 '23 05:05

ArrH