I thought about this recently, but I just remembered to post the answer if anyone else wants it.
TL: DR; = While this is possible, it is completely pointless / more overhead than necessary.
Decision:
What I ended up was synchronizing the areas that were most important, they were (under xampp root):
/htdocs/phpmyadmin/php/mysql/data - the key thing here is not the entire folder, only the data bit
This ensures that the versions of PHP and phpMyAdmin work the same for me and that my databases are present (yay, there is no more export / import!).
The reason I don't sync the apache folder is because my installation on my machines is slightly different (different paths).
I used symbolic links to indicate folders in their locations on Dropbox (yes, I requested Google Drive, but see the end of the answer about why the swap).
This works very well, and I did not find a better solution. Despite the fact that now the virtual machines are changing the moving workflow, I need this portability more because of how much I have to switch between my laptop and my main PC.
Questions:
- I ran into a few minor issues, almost with mysql.
- The MySQL service does not always start when the machine boots, if it synchronizes files when it tries to load, and not the main problem, but a tiny nuance.
- Corrupted databases !: -o It was actually more or less fixed by going to Dropbox from Google Drive, more on that at the end.
- You cannot reliably use both machines at the same time, as this can cause conflicts in the database. When creating a new database, it is best to do this on one machine, allow it to fully boot, then turn off the machine and load another so that it synchronizes in the required material. Sometimes you first need to stop the MySQL service.
Google Drive vs DropBox
I like Google Drive, I used it for everything. It's cheap, with $ 3 for 100 GB of storage or something else compared to $ 10 (10?) DropBox.
After some time, when my projects grew and my htdocs became widespread, I began to notice a few questions. I started using a structure called Laravel 4 for a while, this is due to the large number of files that were brought into the supplier’s directory by the composer. Google Drive seems to have indexed part of it, and then only synced some of the files, but without me.
This will lead to the fact that I will transfer to my laptop after a while, usually away from my PC, and realizing that half of my project is missing and therefore unusable. Files in most cases will not be collected unless I delete the entire folder or some other deception, which was pretty painful during the initial creation of the project.
I also found that the database was corrupted too often when using Google Drive, as the number of files in the Google Drive folder increased, which is even worse.
In the end, I decided to change my htdocs to DropBox. After I had no problems for several weeks, I changed the rest, since then I have had no problems with corrupting the database or lack of folder synchronization. I think this may not be up to Google Drive, it seems unable to handle so many small files (as a rough estimate, the Laravel 4 vendor directory has 4k + files, imagine it as 10 projects plus any other projects not related to laravel 4...).
Database corruption
When using Google Drive, I found a safe way to make sure that my databases are more or less safe, even if they are damaged, I created a batch file (Yup, windows user) to back up the database of all non-default databases ( skipping the ones that come with MySQL / PhpMyAdmin mainly) in the .sql file in a folder not located on Google Drive / DropBox. This means that if my database goes bad, the worst thing that happens is that I lost work on the database for several days, which is usually not a big amount (especially if you use migrations to create tables). It is a simple task - to delete the damaged tables / databases and restore them through the .sql file.