Reputation: 163
Problem: on Windows 7, due to the fact that we can't use nfs (naturally, without hacks), the performance of the couple Vagrant/Magento are really poor.
After so much research, i found that the best way (maybe the only) to solve the problem is to use rsync. Ok, i succeed to use it and the performancies now are really good!
I found a problem: it seems to be that rsync is mono-directional. What i mean? Suppose I do install magento succesfully and then i call "vagrant rsync" command. It will perform a new sync of the folders and, cause it sync the guest file structure with the host file structure, it will "delete" the etc/app/local.xml file that Magento has built for me after the installation, just beacause it doesn't exist in the host file structure.
Now, i read some solution like exclude folders or file from sync, but i think it's really not a great way to solve the problem.
Someone has a better solution? There is a way to sync bidirectionally the two file structures?
UPDATE
I tried to find a solution.
1) I tried to use unison, but i found some kind of error i can't understand. 2) I tried to use the vagrant plugin rsync-back, but it seems it can't find the right folders to sync 3) I finally choose to execute the rsync within the virtual machine. Access through vagrant ssh, execute the command "rsync -av /var/www/ /vagrant. It seems to work.
So, for the moment, the solution to improve the performance of Vagrant and Magento is to activate the rsync system. To solve the uni-directional sync problem, I need to execute the rsync command from the VM if i need to sync from guest to host (viceversa, it's enough to use vagrant rsync).
If you have a better way, please, give it to me!
Upvotes: 3
Views: 2514
Reputation: 51
The problem I had using rsync was it was a mono directional so if my app creates a file on the remote server, it will be deleted when rsynced next time.
I've tried the above suggestions but I've ended up with using ftp.
I'm using phpstorm and use the automatic deployment. So that if I change anything in the file or create a new one then it will automatically upload your files to the remote server (VM).
It's still one way but it works for me.
Upvotes: 0
Reputation: 121
Best option i know is unison (realtime bidirectional folder sync)
vagrant-unison plugin from https://github.com/mrdavidlaing/vagrant-unison is outdated and not functioning.
Get updated version of vagrant-unison plugin here https://github.com/dmatora/vagrant-unison
Upvotes: 5
Reputation: 4802
This is indeed the case right now; Vagrant's rsync support is not bidirectional—it only syncs from your host machine to the VM, and not back. There is an open issue to add two-way sync (rsync-push and rsync-pull), but I'm not sure when this issue will see the light of day.
Some other options, in the meanwhile:
rsync-auto
The main reason I like rsync is because it's one of the simplest/most robust file sync tools available for Mac/Windows/Linux, and since it's already installed on 2/3 of those platforms, only the Windows devs need to do any extra work to get it going. Most other options (NFS, Unison, etc.) require extra software for everyone, and don't offer much in the way of a performance gain over rsynced files.
Upvotes: 1