1 PHP 7 & ComposerĬraft 3 requires PHP 7. We're going to use VirtualBox since it's FREE while VMWare & Parallels need to be licensed. Homestead itself leverages 2 other software packages: Homestead creates a Linux virtual machine VM on your computer host. The advantage of using Homestead is that its tech stack (Ubuntu, PHP, MariaDB, nginx) will match our production environment on Linode. We're going to use Laravel Homestead for our local development environment. This entry was posted in Code and tagged data recovery, homestead, mysql on Januby Paul Silver.This article explains how to install Craft 3 on macOS Mojave. This has a delay built in, so I now know I should have used: I can now use this to restore the databases elsewhere. Sudo let me temporarily have more permissions and do the copy.Ĭhecking in the shared folder, I found all my data. Sudo cp homestead-20190121.sql /media/sf_2019_01_January/īecause the first time I ran it, I didn’t have enough permissions to copy the file. Which lists the share to a folder called “2019 01 January” which I’d set up. That involved re-starting the VM and then once I was logged in, I needed to check what that shared folder was called from within the Ubuntu VM and with more searching based on some very old memories from university, I found this command: I took that as the starting point of some Googling and set up a shared folder using this advice. This gives me a big text file with all the exported data in it, which is great, but the file is still inside the virtual machine, not on my normal file system where I can get at it.Īfter much thought I remembered what Tom had advised me in the first place – mount the VM as a drive. Mysqldump -u homestead -psecret -all-databases > homestead-20190121.sql I’m used to using web based tools for MySQL admin, so had to look this up too: Then I needed to backup my databases on the command line. This boots the virtual machine and gives me a command prompt.Īt “homestead login:” I needed a username and password, the default for a Vagrant built VM is vagrant and vagrant (thanks to Stefan on Stackoverflow for putting up that one.) Open VirtualBox and manually start the machine Vagrant set up by clicking on it and clicking the start icon. That inspired me to start poking around more, here is how I got my data out of the broken Vagrant box… Recovery steps I thought to recover the data and back it up I was going to have to restore a Time Machine backup of the whole computer back to the previous version of the OS – High Sierra.įortunately I mentioned the problem to a few friends (AKA I moaned about my situation) and Tom suggested I mount the VM direct. Upgrading Vagrant would mean wiping the data, so I didn’t want to do that. So I’d lost the development environment, including Apache, MySQL, and some other bits, but not the files of my site and the environment would be easy to set up again as that’s what Vagrant makes simple.īut… I had a bunch of data in two databases within MySQL in the VM that I really wanted to keep. In general, the virtual machine (VM) breaking wasn’t a problem – I have all the site files as part of the point of using Vagrant is having those in a shared folder on your main file system, not only inside the VM Vagrant sets up to hold the development environment. Unfortunately an upgrade of VirtualBox was required for it to run in Mojave, but not the solution to my problem. At first I thought VirtualBox, the software for creating virtual machines, just needed updating. It was a bit of an old version of Vagrant, but still annoying. I recently upgraded my Mac to use Mojave and this broke my old Vagrant install, which I use for Homestead and a bunch of my Laravel based development websites. I’ve now learned how to get data out of a Vagrant run virtual machine when Vagrant itself is broken.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |