top of page
  • Twitter Social Icon
  • Facebook Social Icon
  • LinkedIn Social Icon
Search

Poweshell program for Backup databases from PROD to TEST environment in MS SQL2016

  • Writer: Filip Holub
    Filip Holub
  • Jun 7, 2017
  • 1 min read

Hi guys, We have not seen you for ages!

Today, I will write about backuping in powershell. I often have to deals with with development depatment refresh databases from production environment to testing environment, almost on daily bases. Therefore I wrote small script that have 40 rows.

As you can see, you have to fill in SQL instance, three databases and destination share folder for .bak files.

There is condition, if you have not filled in database name script write only 'Empty'

Here is entire script:

The course looks like this:

Running backup by powershell

This script save me a lot of time, because can use only developers and I do not have to deal with anything. I have created new account that have only role - db_backupoperator. Therefore developers can run under this account and .bak files are saved in testing env..

To be honest, I'm not a native developer :D But it works!

 
 
 

Comentarios


RECENT POST
  • Grey Twitter Icon
  • Grey Facebook Icon
  • Grey LinkedIn Icon

© 2020 All rights reserved. PigeonSQL.com | Filip Holub

bottom of page