I'm migrating 100 plus SQL databases over to a new server in a new location. I have the maintenance plan in place to take full back ups and then a script to copy over the .bak
files to a temp directory. What I'm looking for is a way to mass restore those .bak
files so that I don't have to spend all weekend doing it manually.
I found a decent stored procedure here : SQL Restore
I put it in place and tested and I'm getting the following error:
Msg 3118, Level 16, State 1, Line 1
The database "TF058" does not exist. RESTORE can only create a database when restoring either a full backup or a file backup of the primary file.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
I'm running SQL Server 2012 and the databases are in FULL recovery mode.
Best Answer
You can use
sqlmigration - Start-SqlServerMigration.ps1
Restore Genie - it has both PowerShell and t-SQL version.
I have used both and they are life savers. Highly recommend to test them first. First one is the one that will help in your situation.