Moving the Web Reports SQL database to another hard drive

NOTICE

POTENTIAL FOR DATA LOSS.
The steps detailed in the resolution of this article may result in a loss of critical data if not performed properly. Before beginning these steps, make sure all important data is backed up in the event of data loss. If you are unsure, please contact Product Support Services prior to attempting the procedure below.

Issue

The database files used by the Web Reports SQL database needs to be moved to another location

Product Line

SmartStruxure Solution

Environment

WebReports

SQL server

Cause

There are numerous reason for wanting to do this, but the most common reason is that there is not enough space on the disk SQL is installed on. By moving to another disk this will allow space for future expansion.

Note that this article only describes how to move the database files to another harddrive. The SQL server and database files must still be on the same PC where WebReports is installed.

Resolution

The process is fairly simple:

  1. Start by backing up everything.
  2. Stop the StruxureWare reporting agent service.
  3. Open SQL Management Studio and locate the database.
  4. Right-click on the database and select Tasks-->Detach.
  5. Locate the SQL database files (*.mdf and *.ldf) in Windows explorer.
  6. Cut or copy these files and move them to the desired location.
  7. Go back to SQL Management Studio and select the Databases folder.
  8. Right-click and select Tasks-->Attach database.
  9. When the dialogue opens up, locate the 'ADD' button and click on it.
  10. Browse to the database files' new location and click on OK.
  11. Restart the Struxureware Reporting agent service.