0

I currently have a Vagrant box running on Windows 10 and Virtual Box. I have multiple sites enabled in Apache 2 and Mysql databases within the box. While I keep reding that "vagrant package" will compress the whole box except Shared Folders, I can't find a way to retreive the virtual host configuration and MySQL data on another PC.

I want to copy the whole vagrant environnement to another PC.

Maybe I have a misconception about "vagrant package" command

Steps completed :

(ON ORIGINAL WIN10 PC)

  • 1) vagrant halt
  • 2) vagrant package --output package-20131222.box
  • 3) zip c:\vagrant (containing Vagrantfile and /www/ folder) to vagrant.zip
  • 4) Move package-20131222.box and vagrant.zip to new PC

(ON NEW WIN10 PC)

  • 1) Extract vagrant.zip to c:\vagrant
  • 2) Move package-20131222.box and vagrant box add ubuntu/trusty64 package-20131222.box
  • 3) vagrant up

When I SSH to the box, I cannot find my config files in /etc/apache2/sites-enabled neither can I see phpMyAdmin or my MySQL databases.

Where did I go wrong ?

Thankss !

wlarcheveque
  • 894
  • 1
  • 10
  • 28

1 Answers1

1

ubuntu/trusty64 is an existing box you should assign your new box a unique name and make sure to use this name in your new Vagrantfile.

The following steps on the new windows machine will work

  1. copy package-20131222.box and run vagrant box add mynewbox package-20131222.box

  2. copy only your Vagrantfile from the old box and change the config.vm.box = "mynewbox" (copy any other folder that you need to share with the VM)

  3. vagrant up

The new VM created will contain all content from the previous VM running on the old windows

Frederic Henri
  • 51,761
  • 10
  • 113
  • 139
  • Thanks. Whatever name I used, the Apache config files nor MySQL database can be found within the box... – wlarcheveque Dec 22 '16 at 18:15
  • you need to use this new name in your vagrantfile, if you let the name that comes from the old windows machine, it will create a new VM from the same initial box – Frederic Henri Dec 22 '16 at 20:53