Q: The BlackBerry Enterprise Server in my environment uses the Microsoft Data Engine (MSDE). How do I move the MSDE to a remote Structured Query Language (SQL) or MSDE Server?
A: Please see Support Knowledge Base Article below.
How To - Move the BlackBerry Configuration Database to a new server instance
Doc ID : KB03112
Last Modified : 2007-01-18
Document Type : How To
Environment- BlackBerry® Enterprise Server software versions 2.1 through 4.1
- Microsoft® Exchange
Procedure
Note: If you are logging in to a named instance of Microsoft SQL Server™, use the following command syntax to log in:
osql -E -S <server_name>\<instance_name>
The BlackBerry Enterprise Server services will be stopped during the following process.
Important: Restarting the BlackBerry Enterprise Server will delay message delivery to BlackBerry devices. For more information, see KB04789.
Perform the following tasks using the BlackBerry service account unless otherwise stated:
- Back up the BlackBerry Configuration Database.
- Prepare the new Microsoft SQL Server.
- Restore the BlackBerry Configuration Database.
- Configure the BlackBerry Enterprise Server.
Task 1 - Back Up the BlackBerry Configuration Database
If you are using a full Microsoft SQL Server, follow the steps below:
- Open Enterprise Manager.
- Right-click the BlackBerry Configuration Database (the default name is BESMgmt).
- Select Backup Database.
- Click Add to specify the Directory Name and File Name. Click OK to accept the settings.
- Click OK to perform the backup.
- Close Enterprise Manager.
If you are using a Microsoft SQL Server Desktop Engine (MSDE), follow the steps below:
- Type osql -E at a command prompt. Note: If you are logging in to a named instance of SQL Server, use the following command syntax to log in:
osql -E -S <server_name>\<instance_name>
- Type the following commands in the specified order: 1> backup database <database_name> to disk = "C:\<database_name>.bak"
2> go
1> quit
- Close the command prompt.
Task 2 - Prepare the New Microsoft SQL Server
Complete the four steps below.
Step 1 - Assign appropriate permissions
Note: Perform this task using an account with administrative access to the new SQL Server.
If you are using a full SQL Server, complete the following:
- Open Enterprise Manager.
- Navigate to SQL Server Group/<SQL_server_name>/Security/.
- Right-click Logins and select New Login.
- On the General tab, click the "" button
- Select the name of your BlackBerry service account from the Global Address List.
- Click Add, then clickOK.
- On the Server Roles tab, select Server Administrators and Database Creators. Note: On BlackBerry Enterprise Server software version 4.1, the System Administrator role is needed for Role-Based Administration.
- Close Enterprise Manager.
If you are using an MSDE, complete the following:
- Log in to the new SQL Server.
- Right-click My Computer and click Manage.
- Expand Local Users and Groups.
- Go to Groups, then open the Administrators group.
- Click Add.
- Type the name of the service account and click Check Name.
- Click OK, then close the Computer Management window.
Step 2 - Enable the correct Server Protocols
If you are using an MSDE\Microsoft SQL Server 2000, complete the following:
- Go to Start > Run.
- Type the command svrnetcn and click OK. The SQL Server Network Configuration Utility opens.
- Make sure that TCP/IP and Named Pipes are both listed as enabled protocols.
- Close the SQL Server Network Configuration Utility.
- If you enabled a protocol in step 3, restart the SQL Services.
or
If you are using Microsoft SQL Server 2005 Express\Microsoft SQL Server 2005, complete the following:
- Go to Start > Microsoft SQL Server 2005 > Configuration Tools > SQL Server Configuration Manager > SQL Server 2005 Network Configuration.
- Select the SQL instance that we will be using to house the BlackBerry Configuration Database.
- Enable the TCP/IP and Named Pipes protocols.
- If you enabled a protocol in step 3, restart the SQL Services.
Step 3 - Ensure the SQL Agent is running
Note: This service does not exist in SQL Server 2005 Express.
- Open the Microsoft Windows® Services.
- To do this, go to the Control Panel and open Administrative Tools > Services.
- Verify that the SQL Server Agent service is Started and that its startup type is set to Automatic.
- Close the Services window.
Step 4 - Update the Database Server Schema
Note: If you have already installed the BlackBerry Enterprise Server software to create a blank database on a new server instance, you do not need to perform the following task as the database schema would have already been updated.
- Download the installation package for the version of the BlackBerry Enterprise Server you are using.
- Extract the contents of the installation package.
- Copy the Database folder to the new SQL Server.
- Navigate into the Database folder and open the BESMgmt.cfg file in Microsoft Notepad.
- Locate the line DB_NAME=BESMgmt and make sure that the name specified matches the BlackBerry Configuration Database name.
- If you are using a named instance of SQL Server change the line "SERVER=local" to SERVER=<Server_Name>\<Instance_Name>.
- Save and close the file.
- At a command prompt, navigate to the Database directory.
- Type the command createdb.exe BESMgmt.cfg
- Once the command has finished executing, close the command prompt.
Task 3 - Restore the BlackBerry Configuration Database
Use one of the following methods to restore the BlackBerry Configuration Database, then proceed to Task 4:
Method 1 - Back up and Restore the BlackBerry Configuration Database (on an SQL Server with the same directory structure)
Complete the following steps:
- Copy the BlackBerry Configuration Database backup to the C:\ path of the new SQL Server.
- Type osql -E at a command prompt. Note: If you are logging in to a named instance of SQL Server, use the following command syntax to log in:
osql -E -S <server_name>\<instance_name>
- Type the following commands in the specified order: 1> restore database <database_name> from disk = "c:\<database_name>.bak" with recovery,replace
2> go
1> quit
- Close the command prompt.
Method 2 - Backup and Restore the BlackBerry Configuration Database (on an SQL Server with a different directory structure)
Complete the following steps:
- Copy the BlackBerry Configuration Database backup to the C:\ path of the new SQL Server.
- Type osql -E at a command prompt. Note: If you are logging in to a named instance of SQL Server, use the following command syntax to log in:
osql -E -S <server_name>\<instance_name>
- Type the following commands in the specified order: 1> restore database <database_name> from disk = "c:\<database_name>.bak" with move "<database_name>" to "<new_path>\MSSQL\Data\<database_name>.mdf", move "<database_name>_log" to "<new_path>\MSSQL\Data\<database_name>.ldf"
2> go
1> quit
- Close the command prompt.
Method 3 - Detach and Re-attach the BlackBerry Configuration Database
Perform the following steps:
Step 1 - Stop the BlackBerry Services- Open the Windows Services. To do this, go to the Control Panel and open Administrative Tools>Services.
- Stop each service that has a name that begins with BlackBerry.
Step 2 - Move the BlackBerry Configuration Database files to the new SQL Server
If you are using full SQL Server, complete the following:
- Log in to the original SQL Server.
- Open Enterprise Manager.
- Right-click the BlackBerry Configuration Database.
- Select All Tasks and click Detach Database.
- Close Enterprise Manager.
- Navigate to the SQL Data directory and make a copy of the MDF and LDF files. The default path is C:\Program Files\Microsoft SQL Server\MSSQL\Data\ and the default filenames are BESMgmt.mdf and BESMgmt.ldf.
- Move the file copies to the new SQL Server.
- Log in to the new SQL Server.
- Open Enterprise Manager.
- Right-click the BlackBerry Configuration Database.
- Select All Tasks and click Detach Database.
- Move the files you copied in step 6 into the SQL Data directory. When prompted to overwrite the files, click Yes.
- In Enterprise Manager, right-click the Database folder and click All Tasks.
- Select Attach Database.
- Select the MDF file to attach and click OK.
- Close Enterprise Manager.
If you are using MSDE, complete the following:
- Log in to the first MSDE Server.
- Type osql -E at a command prompt. Note: If you are logging in to a named instance of SQL Server, use the following command syntax to log in:
osql -E -S <server_name>\<instance_name>
- Type the following commands in the specified order: 1> exec sp_detach_db @dbname = "<database_name>"
2> go
1> quit
- Navigate to the SQL Data directory and make a copy of the MDF and LDF files. The default path is C:\Program Files\Microsoft SQL Server\MSSQL\Data\ and the default filenames are BESMgmt.mdf and BESMgmt.ldf.
- Move the file copies to the new SQL Server.
- Log in to the new MSDE Server.
- Type osql -E at a command prompt.
Note: If you are logging in to a named instance of SQL Server, use the following command syntax to log in:osql -E -S <server_name>\<instance_name>
- Type the following commands in the specified order: 1> exec sp_detach_db @dbname = "<database_name>"
2> go
2> quit
Move the files you copied in step 4 into the SQL Data directory. When prompted to overwrite the files, click Yes.
- Type osql -E at a command prompt. Note: If you are logging in to a named instance of SQL Server, use the following command syntax to log in:
osql -E -S <server_name>\<instance_name>
- Type the following commands in the specified order: 1> exec sp_attach_db @dbname = "<database_name>",
2> @filename1 = "C:\Program Files\Microsoft SQL Server\MSSQL\Data\<database_name>.mdf",
3> @filename2 = "C:\Program Files\Microsoft SQL Server\MSSQL\Data\<database_name>.ldf"
4> go
1> quit
- Close the command prompt.
Task 4 - Configure the BlackBerry Enterprise Server to connect to the new BlackBerry Configuration Database
Complete the following steps:
- On the BlackBerry Enterprise Server, click Start > Programs > BlackBerry Enterprise Server > BlackBerry Server Configuration.
- On the Database Connectivity tab, select Change Database.
- In the Change Database Wizard, specify the new SQL Server name and the original BlackBerry Configuration Database name.
- Continue with the wizard. Make sure that the Start Services check box is selected, then click Finish.
- Open the Windows Services and make sure all the BlackBerry services started successfully. The BlackBerry Database Consistency Service may be disabled (this is normal behavior).
- Open BlackBerry Manager and make sure that all BlackBerry device users display and show a running state.
- Test message flow from the BlackBerry device. Note: Restarting the BlackBerry Enterprise Server delays message delivery to BlackBerry devices.
- Close the command prompt.
If you are running BlackBerry Enterprise Server 4.1, install the Database Notification System.
- Copy the RimEsp.dll file to C:\Program Files\Microsoft SQL Server\MSSQL\Binn\ folder on the new SQL Server.
- In SQL Query Analyzer, browse to the \Database\DBInstallScripts\SQLServer\4.1\ folder on the installation media.
- Open the NotifyInstall.sql file and replace <database_name> with the name of the BlackBerry Configuration Database.
- Run the script.
- Confirm that the SQL Query Analyzer displays the message Function dbo.xp_RIM_xxxx registered.