4 ms·
I have a few sites that are on production, staging, and local servers. Each site is powered by its own SQL Server database. There have been times when I have b
by EnderMB 13y ago
I have a few sites that are on production, staging, and local servers. Each site is powered by its own SQL Server database.
There have been times when I have been working on a feature, and have noticed that the CMS content on local/staging is out of date with what is on live.
To fix this, I created a Powershell script to create a backup of the live db, copy it over to the staging server, backup the old db and restore the live db on staging, and to do the same on the local database. It's a bit awkward, but I wanted a one-click method that would sync all three databases, while ensuring that it would fail gracefully and would create backups in case something went wrong.
This works well for my personal projects, but I am looking to rewrite it for work at some point. I work at an agency, so a tool that can sync our db servers would be fantastic.
- NicoJuicy 13y agoLooks a lot like my PowerShell script integrated with my Visual Studio IDE. I have an XML which contains the different servers (testing, dev and production). I'd just type UpdateDatabases -T in package manager console :)=> so testing servers are updated with the latest migration
- EnderMB 13y agoSounds fantastic! Ever considered putting the source up? I've considered pushing mine up on GitHub, but yours sounds better, and would work really well in an agency setting.