# Keep database synced between computers in Trellis/Bedrock/Sage setup

**URL:** https://discourse.roots.io/t/keep-database-synced-between-computers-in-trellis-bedrock-sage-setup/4478
**Category:** trellis
**Created:** 2015-08-14T13:50:40Z
**Posts:** 64
**Showing post:** 13 of 64

## Post 13 by @fullyint — 2015-08-20T17:55:34Z

I haven’t tried syncing raw database files and it sounds like those who have tried saw corrupted tables. Maybe someone else will have better ideas, but you may just have to do an sql dump to a dropbox folder when you leave one work location, then import the db when you arrive at the other location. You could dump/import with Sequel Pro, WP CLI, WP Migrate DB Pro, etc. Maybe you could automate it.

Maybe someone familiar with RDS could comment on whether an [RDS setup](https://discourse.roots.io/t/remote-mysql/4395/5) would work, but maybe that’s overkill for syncing two dev DBs.

All that said, yes, you need to manage owership on sync folders using vagrant-bindfs, as is used with site\_path. I think the user:group of the raw db is root:root (you could double-check if you haven’t already), but again, it’s probably best to not sync the raw db files. You tried root:root and it failed, but I suspect it would work once you add in the bind folder. For reference on implementation, here is where Trellis began using vagrant-bindfs to handle permissions: [roots/trellis#82](https://github.com/roots/trellis/issues/82)

As for how to access variables from `wordpress_sites` in the Vagrantfile, you could use `wordpress_sites['example.com']['env']['db_name']`, but maybe there is a smarter way. Replace `example.com` with whatever your site key is. `site['env']['db_name']` would work if you were looping over the sites, each site represented by the `site` object.

---

_[View the full topic](https://discourse.roots.io/t/keep-database-synced-between-computers-in-trellis-bedrock-sage-setup/4478)._
