Back Up & Restore Procedures

These duties should form part of a coherent policy of regular backup of your document management data under the supervision of the System Administrator.

NB Administrator privileges will be required to carry out many of these actions

It is important to understand that File Stream Document Management data is stored in SQL Server databases but the document images are encrypted and stored separately in the filing system. It is essential to make regular backups of both the SQL Server data, and the document images.

This document describes the steps required to ensure that all File Stream Document Management data is correctly backed up and restored. Please ask your IT to check if they are making daily backups and keeping a rotating set of backups for at last one week before re-using the backup media.

Document Management Backup Procedures

Backing up Document Images

1. Find out where the document images root folder is stored

  • Run File Stream Document Management and log-in as administrator
  • Select the Administration tab on the ribbon
  • Click on the Database button
  • Click on the Change Root Folder button
  • Make a note of the Current Root Folder, then close the open windows

2. Backup the root folder

  • Make a full backup of the root folder, including all files and subfolders it contains.

Backing up SQL Database files

SQL Server data can be backed up using any one of three different methods described below.

Alternatively, if you are familiar with SQL Server administration and backup procedures, you can backup the data directly from SQL Server administration.

It is also possible to directly backup all the relevant SQL Server data and log files directly but this method is not recommended.

1. File Stream Document Management two stage backup method

Use the File Stream Document Management application or the Backup task in the File Stream Scheduler to make a backup of all the SQL data files into a separate backup folder on the hard drive, then use your backup software to backup those files onto your backup media. Please refer to the Identifying Databases and Files section below to understand which files are backed up.

Advantages of this method

  • Users can continue using File Stream during the backup
  • No need to shut down the SQL Server service during backup
  • Backing up from File Stream or the Scheduler additionally truncates the log files to keep the file size to a minimum

Disadvantages of this method

  • Need to time the backups such that the backup from File Stream is complete before the backup to tape

2. Backup from SQL Server Administration

Use this method if you are familiar with the backup process in SQL Server administration.

Run the SQL Server Management Studio (Enterprise Manager in SQL Server 2000), identify all the databases belonging to File Stream Document Management and use the built-in backup tool to make a backup of each File Stream database to tape or to disk as required.

If you use this method please ensure that you have set SQL Server to use the FULL RECOVERY mode, and also make sure you truncate the log files after the backup is complete.

Please refer to the Identifying Databases and Files section below to understand which files should get backed up.

Advantages of this method

  • No need to backup in two stages
  • Users can continue using File Stream during the backup
  • No need to shut down the SQL Server service during backup
  • SQL Server can be scheduled to run these tasks automatically at set times

Disadvantages of this method

  • This is an advanced method which requires knowledge of the backup process in SQL Server administration
  • Need to set recovery mode and truncate files from SQL Server administration

The following SQL script shows how you can backup a single database and truncate the log file. Please note that you need to repeat this for each of the databases

— SET FULL recovery option
ALTER DATABASE [DATABASENAME] SET RECOVERY FULL

— back up the database file
BACKUP DATABASE [DATABASENAME] TO DISK=’C:backup folderDATABASENAME.BAK’ WITH INIT

— back up the log file
BACKUP LOG [DATABASENAME] TO DISK=’C:backup folderDATABASENAME_Log.BAK’ WITH INIT

— shrink the log file to 1 MB
DBCC SHRINKFILE (‘DATABASENAME_Log’, 1)

3. Direct Backup

To use this method, follow these steps

  • Find out where SQL Server stores all the File Stream data and log files
  • Ask all users to log out of File Stream
  • Shut down the SQL Server service
  • Make a backup of all the data and log files to your backup media
  • Re-start the SQL Server service

Please refer to the Identifying Databases and Files section below to understand which files should get backed up.

Advantages of this method

  • This is a more direct method without the need to run File Stream or SQL Server administration

Disadvantages of this method

  • Users need to log out of the system
  • Need to shut down the SQL Server service
  • Need to manually truncate log files periodically

Restore Procedures for File Stream Document Management

You should always restore the SQL data files first before restoring the document images

Restoring Database Files

If you can restore the database files to their original location, then follow these steps…

  • Ensure all users have logged out and closed File Stream Document Management
  • On the SQL Server machine shut down the SQL Server service
  • Use your backup software to restore all the database files back to the original location
  • Start the SQL Server service

If you have to restore the database files to a different location or drive on the original machine, then follow these steps…

  • Ensure all users have logged out and closed File Stream Document Management
  • Start SQL Server Management Studio ( Enterprise manager on SQL Server 2000)
  • Detach all the relevant File Stream databases from SQL Server
  • Use your backup software to restore all the database files to the new location
  • Go back to Server Management Studio ( Enterprise manager on SQL Server 2000)
  • Attach the restored databases to the SQL Server
  • Re-start the SQL Server service

If you have to restore the database to a different machine, then follow these steps…

  • Install the same version of SQL Server on the new machine as you had on the original machine
  • Use your backup software to restore all the database files to the new location
  • Start Server Management Studio ( Enterprise manager on SQL Server 2000)
  • Attach the restored databases to the SQL Server
  • Re-start the SQL Server service

Restoring Document Images

If it is possible to restore the images to their original location then use your backup software to restore files and folders back to their original location.

If you need to restore to a different location or drive, then simply create a top level folder which will be your new root folder and restore all files and folders from the backup into the new folder. Then follow these steps to point File Stream to the new root folder.

  • Run File Stream Document Management and log-in as administrator
  • Select the Administration tab on the ribbon
  • Click on the Database button
  • Click on the Change Root Folder button
  • Type in the location of the New Root Folder
  • Click OK to save the changes

Identifying Databases and Files

A database in File Stream Document Management consists of more than one database in SQL Server.

As an example, if your File Stream database is named “PLUTO” and you have created it for the years 2007 to 2010, then SQL Server will contain 5 databases in total all of which need to be backed up.

These databases will be called…

PLUTO
PLUTO-2007
PLUTO-2008
PLUTO-2009
PLUTO-2010

Each of these databases in turn consists of two files, the main data file and a corresponding log file. You can find the location of these files by running SQL Server Management Studio (Enterprise Manager in SQL Server 2000) and looking at the properties on each of the above databases

In the above example, the database files will be named…

PLUTO.MDB
PLUTO_Log.LDF
PLUTO-2007.MDB
PLUTO-2007_Log.LDF
PLUTO-2008.MDB
PLUTO-2008_Log.LDF
PLUTO-2009.MDB
PLUTO-2009_Log.LDF
PLUTO-2010.MDB
PLUTO-2010_Log.LDF

Once backed up, the log files (LDF Files) need to be truncated to keep their size down to a manageable level.

If you have any questions regarding the technical side of our software, please do not hesitate to get in touch.