Backup-Zip-Copy-Unzip-Restore-Notify SQL Server Databases

Backup-Zip-Copy-Unzip-Restore SQL Server Databases:

I am sure we all try to bring databases from One Environment to Another Environment whether its to accomplish testing, debugging or maintaining the parity between production and lab.

I used to spend little bit of time doing these tasks manually , after few attempts, it was apparent this is  not the most enjoyable task. Its one of those things that needs to be done but nothing more than than.

I gathered Powershell scripts available online as well as made some modifications to suit my needs. My pain point was synching databases from Production / Staging Environment where the database needs to be copied across data centers.

Tasks I want to accomplish with this scripts are:

1. Backup the Databases from the Source Server.

2 . Zip the Backup Folder

3. Copy the Zipped Folder to Destination and unzip

4. Restore the databases on the Target Server.

I know there are lot of improvements can be made for this script but it does all the tasks I wanted to do.

Load the Assemblies. I was getting some erorrs with with Assembly references and I am loading all the assemblies.

Leave a Reply

Your email address will not be published. Required fields are marked *

*