This article applies to:
- Trustwave MailMarshal (SEG)
- Trustwave ECM/MailMarshal Exchange
Question:
How do I move my SEG/MailMarshal SQL database to a new server?
Procedure:
This article describes how to move a Trustwave SEG/MailMarshal SQL database to a new server. You can also follow these instructions to move the database files to a new disk location on the same server.
- For notes about other databases used by some SEG versions, see the Notes section below.
- For instructions on how to move Trustwave SEG software to a new server, refer to the following knowledge base article:
- Q10409: How do I move SEG to a new server?
Before moving the database:
When planning where to host the database, verify that the SQL Server software meets the version and service pack prerequisites for your release of SEG. See the release notes and User Guide. SQL 2005 versions are not supported with SEG 7.5 and above.
Be aware of the database size limitations (set by Microsoft) for the various editions of SQL Express. These limitations apply to the data records (transaction logs are not counted).
- SQL Express 2005 and SQL Express 2008: 4GB
- SQL Express 2008 R2 and above: 10GB
- Full licensed versions of SQL Server do not have artificial limitations on database size.
Before beginning the process of moving the MailMarshal database:
-
Close all instances of Configurator, Console, and (for older versions) Reports.
-
For SEG/MailMarshal SMTP 6.X and above, or ECM/MailMarshal Exchange 7.X, stop the Array Manager service (mail will continue to flow).
-
Ensure that Marshal Reporting Console is not using the database. To stop scheduled execution, you may need to stop the Report Executor Service on the MRC computer.
Moving the database:
To move the database, detach it from the SQL Server, move the files, and then attach it to the new SQL Server.
The easiest way to accomplish the detach and attach, as well as other database tasks, is to use SQL Server Management Studio. If you do not have this software, you can download a free edition from Microsoft:
(You can also use the OSQL command line tool. See details in the Notes section below.)
Note: You must use a SQL Server login with the SysAdmin server role. By default the SA login and Windows administrators have this permission. Database Owner or dbo permission for the databases is not sufficient.
- Determine the SQL server, instance, and database name (See the SEG Server Tool).
- Using SSMS, connect to the SQL instance (such as SEGServer or SEGServer\SQLEXPRESS)
- In the menu tree, expand the Databases item.
- Right-click the database name and click Tasks > Detach. Verify that the database is ready to detach, and then click OK.
- If the detach window shows "Active connections", make sure all MailMarshal services and interfaces are stopped.
- Copy the database files from the old SQL server to the new SQL server. By default in SEG 7.5 and above, the SEG database files are called trustwaveseg.mdf and trustwaveseg_log.ldf. The names will differ if the database name differs. Earlier versions used the database name MailMarshal.
- The SQL database files are located in a subfolder named Data within the SQL Server installation folder. If the server hosts more than one instance of SQL Express or SQL Server, ensure you have located the correct Data folder. Example locations are:
- C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
- C:\Program Files (x86)\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA
- Place the two files in the new location (the SQL data directory on the new SQL server).
- If moving between instances on the same server, move both files (do not copy) to avoid problems with selection of the incorrect LDF when attaching.
- Using SSMS, connect to the new server/instance.
- In the menu tree, right-click the Databases item and click Tasks > Attach.
- On the Attach window, click Add, browse to the location of the .mdf file, and select it.
- Click OK to attach the database.
After moving the database:
Reconfigure the SEG or ECM server so that it uses the relocated database.
-
Use the Database tab of the SEG or ECM Server Tool on the Array Manager.
-
Enter the new database location.
-
When prompted, choose Use database.
-
When prompted, restart services.
-
If you have additional processing servers, it may take a few minutes for the Configurator to show their status as "running". No action is required.
- Update Marshal Reporting Console with the new database location
Notes:
- The default name of the database when created in SEG 7.5 and above is TrustwaveSEG. Earlier versions used the default name MailMarshal. Upgrade does not change the name of the database.
- Similar steps apply for the Syslog database (SEG 8.0 and above).
- To move the MailMarshal (SEG) 10.X Configuration Service database, stop the SEG Configuration Service website.
If you do not have SSMS you can perform the tasks using the Microsoft command line tool, OSQL. SSMS is free and recommended.
Detach and Attach Using OSQL
- From a command prompt run the following command to connect to the source SQL server:
osql -S <servername> -U <username> -P <password>
Note: The option switches -S, -U, and -P are case sensitive; use upper case.
For example, if the server name is proxy and you are using SQL Express with the SA account and password sekrit , run the following command:
osql -S proxy -U sa -P sekrit
- Detach the database by running the following command:
exec sp_detach_db 'TrustwaveSEG'
go
Where 'TrustwaveSEG' is the name of the database.
- Copy the database files from the old SQL server to the new SQL server. By default, the SQL database files are in the \MSSQL\Data directory within the SQL Server installation. For this example, the files are called TrustwaveSEG .mdf and TrustwaveSEG _log.ldf. Copy these two files to the new location (the SQL data directory on the new SQL server).
- Connect to the destination SQL server. Use the process described in step 1.
- Once connected to the destination SQL server, run the following command (Substitute the correct database name, file names, and locations): exec sp_attach_db @dbname='TrustwaveSEG',
@filename1='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\TrustwaveSEG.mdf',
@filename2='C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\TrustwaveSEG_log.ldf'
go
- This article was previously published as:
- NETIQKB29208
- Marshal KB140