I've recently had to reinstall XAMPP onto my PC, which means another pain of having to replace any config files I had previously set up and any other data files (such as MySQL databases, websites etc).
I've done as much research into this as possible - but most people only seem to want to sync their htdocs and mysql data, however, I want to store the whole xampp installation on Google Drive, meaning no more having to set it up on other computers etc.
Is it possible? Advantages/disadvantages?
If XAMPP isn't recommend, would a seperate installation of apache/mysql/php on google drive be sufficient?
I have two ideas of how to go about this:
I figured this out myself quite a while ago, but I just remembered to post the answer in case anyone else wants it too.
TL:DR; = While it is possible, it's quite pointless / more overhead than needed.
What I ended up doing was syncing the areas that were most important, these were (under the xampp root):
/mysql/data- Key thing here is not the whole folder, just the data bit
This ensures the versions of PHP and phpMyAdmin I have running are all the same, and that my databases are present (yay, no more export/imports!).
The reason I do not sync the
apache folder is because my setup on my machines is slightly different (different paths).
I used symlinks to point the folders to their locations on Dropbox (Yes, I did ask for Google Drive, but see end of answer for why the swap).
It works quite nicely, and I haven't found a better solution. Although there is a shift of moving workflow onto Virtual Machines now, I need this portability more due to how much I have to switch between my laptop and my main PC.
I love Google Drive, I used it for everything. It's cheap, with like $3 for 100GB of space or whatever in comparison to the $10(£10?) of DropBox.
After a while, as my projects grew and my htdocs became massive, I started noticing several issues. I started using a framework called Laravel 4 for a while, this involved a lot of files being brought into the vendor directory by composer. Google Drive seemed to index part of it and then only sync some of the files, but without me realising.
This would result in me going to my laptop a while later, usually away from my PC, and realising half my project was missing and thus unusable. The files in most cases wouldn't be picked up unless I deleted the whole folder or some other trickery, which was quite a pain on initial project creation.
I also found the database corrupted far too often when using Google Drive, as the amount of files in the Google Drive folder increased, the worse it got.
Eventually, I decided to swap my
htdocs to DropBox. After having no issues for weeks, I swapped the rest over, ever since then I've had no issues with the database corrupting or any folders not being synced. I think this may be down to Google Drive seemingly not able to handle so many small files (as a rough estimate, Laravel 4 vendor directory has 4k+ files, imagine this on like 10 projects plus any other projects not on laravel 4...).
While still using Google Drive I found a safe way to make sure my databases more or less were safe even if corrupted, I created a batch file (Yup, windows user) to do a database backup of all non-default databases (skipping the ones that come with MySQL / PhpMyAdmin basically) to a .sql file in a folder not on Google Drive/DropBox. That means if my database did corrupt, the worst that happens is I've lost a days work on the database, which usually does not amount to much (especially if you use migrations to create tables). It's just a simple task of dropping the corrupted tables/databases and restoring them through the .sql file.