user2169954
user2169954

Reputation: 11

SQL Server 2012 restore excluding filestream

I have a SQL Server 2008 database which has filestream.

I need to backup this database excluding filestream and restore the database on SQL Server 2012.

I have researched this and found:

http://social.msdn.microsoft.com/Forums/en-US/sqldisasterrecovery/thread/bcd5dddf-5a66-42a9-acf4-a63136f3658a

This works when I am backing up the database without filestream and restoring on to SQL Server 2008, as per instructions of the URL.

However, when I run the scripts to restore to 2012, i get the following errors:

Msg 3634, Level 16, State 1, Line 3
The operating system returned the error '3(The system cannot find the path specified.)' while attempting 'FindFirstFile' on X

Msg 5520, Level 16, State 1, Line 3
Upgrade of FILESTREAM container ID 65537 in the database ID 10 failed because of container size recalculation error. Examine the previous errorlog entries for errors, and take the appropriate corrective actions.

Msg 5056, Level 16, State 6, Line 3
Cannot add, remove, or modify a file in filegroup 'FileStreamFileGroup' because the filegroup is not online.
Msg 3013, Level 16, State 1, Line 3
RESTORE DATABASE is terminating abnormally.

I think it has something to do with SQL upgrading the database from 2008 to 2012.

Any ideas? Any help would be much appreciated.

Upvotes: 1

Views: 2324

Answers (1)

Bassam Alugili
Bassam Alugili

Reputation: 17003

I have the same problem and I have solved with rewriting the Backup and Restore methods by using the Smo libraries.

Examples:
Backup Example
Restore Example

By the way I'm doing the following in case Partial backup or restore.

  if (partial)
  {
    sqlRestore.Partial = true;
    sqlRestore.ContinueAfterError = true;
  }

I hope this will help you.

~Bassam

Upvotes: 1

Related Questions