Move Filestream Filegroup to New Location


There are a few ways to move Filestream data to new location but the easier way to do is to do a full backup and restore of the whole database with MOVE command.

Here is a sample snippet:

RESTORE DATABASE [FilestreamTestRestore2] FROM DISK = N’D:\MSSQL\FilestreamTest_FULL.bak’

WITH

–FILE = 1,

MOVE N’FilestreamTest’ TO N’D:\MSSQL\DATA\FilestreamTest.mdf’,

MOVE N’FilestreamTest_log’ TO N’D:\MSSQL\DATA\FilestreamTest_log.ldf’,

MOVE N’FilestreamFileGroup’ TO N’D:\MSSQL\DATA\myfileGroupNew’,

NOUNLOAD, REPLACE, STATS = 10

GO

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s