Reputation: 36411
I am using sugarsync to sync the localhost folders between a mac and a PC,
I want to sync the the database also.
Can I do it by simply synchronizing folders (I use xampp on the PC and WAMP on the mac) or is it more complicated then that?
and if it is possible what files and folder I should synchronize?
Upvotes: 1
Views: 3949
Reputation: 1027
Question is a year old but in case anyone else comes across it, thought I'd add this. I've actually been doing exactly what this person was attempting for a couple of years using Dropbox. I put the MySQL data files into a shared Dropbox folder and edit mysql.ini to let it know that they're not in the default location. The key to making it work successfully is starting / stopping MySQL when you switch between computers. If I'm working at home, for example, I'll fire up EasyPHP (using that instead of XAMPP). My htdocs are in a symlinked folder that is also shared via Dropbox. I do my work here, then shut down EasyPHP. When I go into the office, everything is sync'd and I fire up EasyPHP there.
On the occasion when I forget to shut down EasyPHP in one location or the other the db won't sync (the data file gets locked down, as the others noted) so I simply log into the other machine via LogMeIn, shut down EasyPHP and a minute or two later I'm good to go.
I'm sure there are plenty of reasons why this isn't the "right" way to do it but it's worked flawlessly for me with zero loss of data or errors.
Upvotes: 3
Reputation: 12221
In short this is not a good idea and I dont think it will be possible. The database files are essentially locked down as the database server needs to have exclusive access to it. There is no way sugarsync can know what state those files are in so it might actually copy half completed files from source to destination. It might even corrupt your databases completely as sugarsync might block access to the data file during a critical operation
If you need to keep synchronised copies of the databases here is some ideas for you.
Upvotes: 5