2

I'm not sure if this question has been asked because it's possible that I don't know how to ask the questino properly, but here goes...

I have two Azure SQL Databases. One is for testing and one is for production. In my CI/CD process, I would like to be able to take a copy of production (database) and restore it on top of the testing database. Everything I've read explains how to delete the existing database and restore a dacpac file in it's place. I don't want to do that because it's difficult as it is to create SQL user accounts and set permissions on them, so I would prefer to simply restore on top of the testing database. Is that possible with Azure SQL Databases? If so, could someone please enlighten me?

1 Answer 1

2

No. It is not possible. If you restore from a bacpac or restore from automated backups it will always create a new database as result of the restore. Have you tried to create your test database using CREATE DATABASE AS COPY OF?

DROP DATABASE MyTestDB;
CREATE DATABASE MyTestDB AS COPY OF MyProdDB;
Sign up to request clarification or add additional context in comments.

1 Comment

Absolutely cannot believe it was as easy as that. WOW! Thank you so much for the quick fix. This really did make my day.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.