Changing the version controlled database - anything to be aware of?
mr_gooding
Posts: 5 Bronze 1
Hi All,
I'm looking to change our source controlled database from the production environment to a pre production one (on separate database servers). Is it as simple as making sure anything that is under source control (currently just objects, not data) is aligned across the two databases and unlinking from one and linking to the other, or is there anything else to be aware of?
I've ensured all users (windows Authentication and SQL) are present on both to ensure no permission based dependencies cause issues.
This will allow us to develop locally, promote code into the pre-production (source controlled and not a shared database), which is then released to production
Appreciate any tips from anyone who has done this before.
James
I'm looking to change our source controlled database from the production environment to a pre production one (on separate database servers). Is it as simple as making sure anything that is under source control (currently just objects, not data) is aligned across the two databases and unlinking from one and linking to the other, or is there anything else to be aware of?
I've ensured all users (windows Authentication and SQL) are present on both to ensure no permission based dependencies cause issues.
This will allow us to develop locally, promote code into the pre-production (source controlled and not a shared database), which is then released to production
Appreciate any tips from anyone who has done this before.
James
Comments
With regards moving your source control to the pre-prod DB, the simple answer is to use something like SQL Compare to sync yp the schemas and then unlink prod and link pre-prod.
But as I mentioned, you really you should be doing that all the way down to dev and then using source code as the source of truth for all deployments to your test/pre-prod/prod dbs.
DevOps Mentor and Coach
Director of DLM Consultants
Creator of Speaking Mentors
Microsoft Data Platform MVP
Friend of Redgate
Twitter / LinkedIn
Appreciate you taking the time to respond.
Sorry, I have not done this before yet..
Sorry. No idea...
I'd ensure nothing from production is shown in the Commit tab. Be sure you have no filters.
Then unlink and you can link the VCS to dev. That's where you should be committing from. For pre-prod, send changes from the VCS in the same manner you'd deploy to prod. This way you practice deployments, which is why you have pre-prod.
If you need to get pre-prod ready, a restore from production (assuming no sensitive data) or a schema compare deployment from prod->pre-prod is a way to get started.
If you had any sensitive data in prod you might want to consider using SQL Data Masker or something similar to ensure this data is not being used in dev. (Especially if you have any PII data regarding EU citizens. #GDPR)
https://www.red-gate.com/products/dba/data-masker/index
(Of course, if you do have such data in dev I strongly recommend that you don't admit that fact in a public forum.)
DevOps Mentor and Coach
Director of DLM Consultants
Creator of Speaking Mentors
Microsoft Data Platform MVP
Friend of Redgate
Twitter / LinkedIn