How to move the SQL Server Filestream folder (or db files) to a new location.
Posted by Sanjeev on 16 May 2019 01:36 PM

In this example we are assuming that the current Docsvault database path is C:\DVSB DATA and the file stream folder is located at C:\DVSB DATA\DVFStream

Please follow the steps below in specified order:

  1. Stop all Docsvault Services from the Docsvault Server Manager
  2. Open SQL server management studio and connect to the SQL server using the sa user and password.
  3. In the instance select your Docsvault Database and detach it using the Right-Click > Task > Detach menu
  4. In Detach Database window select the “Drop Connections” Checkbox and click OK
  5. Once the database is detached move the Filestream folder (and the DB files if desired) to a new location. Let’s say we are now moving the Filestream folder “DVFStream” to the location D:\
  6. Now use the following SQL Query to attach your database with the new file stream location.

USE [master]

                CREATE DATABASE [DVSB] ON

                (FILENAME = N'C:\DVSB Data\DVSB.mdf' ), -- Path of mdf file

                (FILENAME = N'C:\DVSB Data\DVSB_log.ldf' ), -- Path of ldf file

                (FILENAME = N'D:\DVFStream' ) -- Path of file stream folder

                FOR ATTACH

After this your database is ready to use at the new locations.

Note: You may need to assign proper security to the DVFStream folder at the new location if required.