DFSR Database Rebuild

by , under Active Directory

While using DFS Replication, you may encounter problems or file is not replicated if file is in use. In this situation, we had to replicate files manually several times. We first killed all handles to the file and overwrote the file with the newer one. But this action has a side effect, keep reading.

DFSR holds metadata in a database for every file and folder inside replicated folder. Replication is decided according to these data. If file is touched out of DFSR, this metadata might be broken or out of date and file or folder is not replicated any more via DFSR. Removing file or folder from source folder, cleaning them from target and readding to source folder might recreate the items in destination usually.

But if you have multiple destinations and only one is broken, method above might be an unnecessary burden for whole system and network. What is more, it did not worked for us in some extreme situations. In this case, we had to rebuild DFSR database to solve the problem. Thanks God, it worked!

DFSR database is under “System Volume Information” folder of the partition DFSR target resides. To get into and work on it, it is necessary to be “system” user, that is why we use psexec, to become system user.

So much talk again. Here it is:

[code language=”bash”]
net stop dfsr

psexec -s cmd
cd "System Volume Information"
move database_XXX database_XXX_old

net start dfsr
Hope you do not need this any time!
Good days…