Restore multiple SQL databases in one go

Say you want to move some hundred SQL databases onto a new SQL server without a lot of boring manual work.

A nice Powershell script is published at Technet:

remember to:

remove the -norecovery switch at the end of the script

import-module SQLPS

Example, run the script like this:

.\restoreSQL.ps1 "D:\Backup" "<yourSQLinstance>" "D:\Data" "E:\Logs"

I’ve successfully tested this on SQL 2016 and 2017

More articles