question

jangi avatar image
jangi asked

restoring all full backups in one run

I have like around 85 databases to restore, currently all .bak files are in one folder. How can I restore all databases in one run ?

Can we automate this ?

Just FYI: Each databases has multiple ndf files

Please Help

sql-serverrestorefull
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Kev Riley avatar image
Kev Riley answered

Have you looked into the Powershell commands from dbatools?

You might find Restore-DbaDatabase is useful for you: https://docs.dbatools.io/#Restore-DbaDatabase

Upon being passed a list of potential backups files this command will scan the files, select those that contain SQL Server backup sets.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.