Backing up and restoring folder structure only

  • 4 March 2022
  • 3 replies

Userlevel 2
Badge +4

Hi all.

I am following best practice for SQL server VM backups by snapping the OS and SQL program file drives only, filtering out the drives that hold the databases.

So if we lose the VM, we restore the VM from snap backup, add drives and then use the SQL agent to restore the databases.

The issue we have is that to do the restore requires folders to be manually created on the newly added drives, and on some of our SQL servers with multi instances there can be a great many of these.

There doesn’t seem to be an option for the SQL restore to create the folders it needs so I had the idea of using the file agent to backup the drives, but filtering out all files, so it effectively just backs up the folders.

We could then use the file agent to restore the folder structure and the sql agent to put the databases in the folders.

I can’t quite work out though, how to filter out all files, but keep the folders.

Can anyone help?



Best answer by Hyder 4 March 2022, 14:52

View original

If you have a question or comment, please create a topic

3 replies

Userlevel 3
Badge +8

What if you just did a wildcard filter for the file extensions within the folders like *.dmp I think then only the folders will be protected and no objects underneath the folder structure.

Userlevel 2
Badge +4


Yes, that’s actually a really good idea, I hadn’t thought of trying to make it backup a generic file, rather than filtering out.

Cheers I will try it.

Userlevel 2
Badge +4

So yes, I added *.* to the filters, but an exception of *.org (random suffix), and it has just capture the folder structure.