- BlackBerry Enterprise Server 2.1 to 5.0 SP4
- BlackBerry Enterprise Server for Office 365
- Microsoft SQL Server 2000 SP3 to 2012
- Microsoft SQL Server Desktop Engine (MSDE)
Confirm that the Database version is compatible with the Microsoft SQL Server version before moving the BlackBerry Configuration Database to a new Microsoft SQL Server instance. Refer to compatibility matrix at:
BlackBerry Enterprise Server Compatibility Matrix
The BlackBerry Enterprise Server services must be stopped during the process described in this article.
Note: In a Microsoft Exchange environment, complete the tasks using the BlackBerry Enterprise Server service account unless otherwise stated.
Complete the following tasks to move the BlackBerry Configuration Database to a new Microsoft SQL Server instance:
Task 1: Prepare the new Microsoft SQL Server
Task 2: Back up the BlackBerry Configuration Database
Task 3: Restore the BlackBerry Configuration Database
Task 4: Configure the BlackBerry Enterprise Server
Task 1 - Prepare the new Microsoft SQL Server
Note: Complete this task using an account with administrator access to the new Microsoft SQL Server. Microsoft SQL Server 2005 or 2008 requires the following server role permissions:
System Administrator, Database Creator.
Step 1: Assign the appropriate permissions based on the applicable environment
Microsoft SQL Server 2000 to 2012
-
Open Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 to 2012).
-
Go to Microsoft Server Group > <SQL_Server_name> > Security.
-
Right-click Logins and select New Login.
-
From the General tab, click the double quotation marks ( "" ) button.
-
From the Global Address List, select the name of the BlackBerry Enterprise Server service account.
-
Click Add, then click OK.
-
On the Server Roles tab, select Server Administrators and Database Creators.
Note: In BlackBerry Enterprise Server 4.1, the System Administrator role is needed for role-based administration. -
Close Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 to 2012).
Microsoft SQL Server Desktop Engine (MSDE)
-
Log in to the new Microsoft SQL Server.
-
Right-click My Computer, and click Manage.
-
Expand Local Users and Groups.
-
Select Groups and then click the Administrators group.
-
Click Add.
-
Type the name of the BlackBerry Enterprise Server service account and then click Check Name.
-
Click OK.
-
Close the Computer Management window.
- Step 2: Turn on the correct server protocols based on the applicable environment
Microsoft SQL Server 2008 to 2012 Express or Microsoft SQL Server2008 to 2012
-
Click Start > Microsoft SQL Server 20xx > Configuration Tools > SQL Server Configuration Manager.
-
Expand SQL Server Network Configuration.
-
Select the Microsoft SQL Server instance that will be used for the BlackBerry Configuration Database.
-
If necessary, turn on the TCP/IP and Named Pipes protocols.
-
If a protocol is turned on in the previous step, restart the Microsoft SQL Server services.
Microsoft SQL Server 2005 Express or Microsoft SQL Server 2005
-
Click Start > Microsoft SQL Server 2005 > Configuration Tools > Microsoft Server Configuration Manager > Microsoft Server 2005 Network Configuration.
-
Select the Microsoft SQL Server instance that will be used for the BlackBerry Configuration Database.
-
If necessary, turn on the TCP/IP and Named Pipes protocols.
-
If a protocol is turned on in the previous step, restart the Microsoft SQL Server services.
Microsoft SQL Server Desktop Engine (MSDE) or Microsoft SQL Server 2000
-
Click Start > Run.
-
Type svrnetcn.
-
Click OK. The Microsoft Server Network Configuration Utility opens.
-
Make sure that TCP/IP and Named Pipes are both listed as protocols that have been turned on.
-
Close the Microsoft Server Network Configuration Utility.
-
If a protocol is turned on in step 2, restart the Microsoft SQL services.
Step 3: Make sure that the SQL Server Agent service is running
Note: This step only applies to BlackBerry Enterprise Server 4.1.7 and earlier. BlackBerry Enterprise Server 5.0 and later no longer relies on the SQL Server Agent service for maintenance procedures.
Note: The SQL Server Agent service is not available for Microsoft SQL Server Express editions. If running Microsoft SQL Server 2005 Express or Microsoft SQL Server 2008 Express, see KB14017.
-
Open the Windows Control Panel, then open Administrative Tools > Services.
-
Make sure that the SQL Server Agent service is started for the instance and that the Startup type is set to Automatic.
-
Close the Services window.
Step 4: Update the BlackBerry Configuration Database schema
Important: If the BlackBerry Enterprise Server software was installed to create a blank BlackBerry Configuration Database on a new Microsoft SQL Server instance, do not perform the following steps, because the schema has already been updated.
Note: If you are running BlackBerry Enterprise Server 5.0, CreateDB.exe is recommended, but not necessary to run prior to restoring the database backup.
-
Download the installation package for the version of the BlackBerry Enterprise Server that is being used.
-
Extract the contents of the installation package.
-
Copy the Database folder to the new Microsoft SQL Server.
Note: The default location of this folder is C:\Research In Motion\BlackBerry Enterprise Server 4.x.x\Database -
Go to the Database folder and open the BESMgmt.cfg file in a text editor, such as Notepad.
-
Locate the DB_NAME=BESMgmt or (DATABASE_NAME=BESMgmt) line depending on the version of the upgrade and then make sure that the name specified matches the BlackBerry Configuration Database name.
-
If using a named instance of Microsoft SQL Server, change the SERVER=local line to SERVER=<SQL_Server_Name>\< instance_name>.
-
Close the file, and Save the changes.
-
From a command prompt, navigate to the Database directory.
-
Type createdb.exe BESMgmt.cfg and press Enter.
-
After the command has finished executing, close the command prompt.
Task 2 - Back up the BlackBerry Configuration Database
Note: When backing up the BlackBerry Configuration Database, complete the steps based on the applicable environment.
Microsoft SQL Server 2000 to 2012
- Open Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008).
- Right-click the BlackBerry Configuration Database (for example, BESMgmt).
- Select Backup Database.
- Click Add to specify the Directory Name and File Name.
- Click OK to accept the settings.
- Click OK again to start the backup process.
- Close Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008) when the process is complete.
Microsoft SQL Server Desktop Engine (MSDE)
- From a command prompt, type osql -E and press Enter.
Note: If logging in to a named instance of the Microsoft SQL Server, use the following command syntax to log in: osql -E -S <SQL_Server_name>\<instance_name> - Type the following commands in the specified order:
- backup database <BlackBerry_Configuration_Database_name> to disk = 'C:\<BlackBerry_Configuration_Database_name>.bak'
- go
- quit
- Close the command prompt.
Task 3 - Restore the BlackBerry Configuration Database
There are two methods available to restore the BlackBerry Configuration Database and each are dependent upon the applicable environment:
-
Restore the BlackBerry Configuration Database from a backup
-
Detaching and re-attaching the BlackBerry Configuration Database files.
Restore database method for Microsoft SQL Server 2000 to 2012
- Open Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 to 2012).
- Right-click the Databases (for example, BESMgmt).
- Select Tasks>Restore Database.
- Click From Device and browse for the .bak file.
- Select Options and ensure Overwrite the existing database is selected.
- Click OK to accept the selection.
- Close Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 to 2012) when the process is complete.
Detach and re-attach database method for Microsoft SQL Server 2000 to 2012
- Open the Control Panel, and open Administrative Tools > Services.
- Stop each service that has a name that begins with BlackBerry.
- Log in to the existing Microsoft SQL Server.
- Open Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 to 2012).
- Right-click the BlackBerry Configuration Database name.
- Select All Tasks, and click Detach Database for Microsoft SQL Server 2000 or for Microsoft SQL Server 2005 or 2008, select Tasks and click Detach.
- Close Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 to 2012).
- Go to the Microsoft SQL Server Data directory and copy the MDF and LDF files.
Note: The default path is C:\Program Files\Microsoft SQL Server\MSSQL\Data\ and the default filenames are BESMgmt.mdf and BESMgmt.ldf. - Log in to the new Microsoft SQL Server.
- Open Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 to 2012).
- Right-click the BlackBerry Configuration Database name.
- Select All Tasks, then click Detach Database for Microsoft SQL Server 2000 or for Microsoft SQL Server 2005 select Tasks and click Detach.
- Move the files that were copied in step 8 to the Microsoft SQL Server Data directory.
- When prompted to overwrite the files, click Yes.
- In Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008), right-click the Database folder, then click All Tasks.
- Select Attach Database for Microsoft SQL Server 2000 or for Microsoft SQL 2005 to 2012 right-click the Database folder and select Attach.
- Select the MDF file to attach, then click OK.
- Close Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 to 2012).
Restore database method for Microsoft SQL Server Desktop Engine on a Microsoft SQL Server having the same directory structure
- Copy the BlackBerry Configuration Database backup to the C:\ path of the new Microsoft SQL Server.
- From a command prompt, type osql -E and press Enter.
Note: When logging in to a named instance of the Microsoft SQL Server, use the following command: osql -E -S <SQL_Server_name>\<instance_name> - Type the following commands in the specified order:
- restore database <BlackBerry_Configuration_Database_name> from disk = 'c:\<BlackBerry_Configuration_Database_name>.bak' with recovery, replace
- go
- quit
- Close the command prompt.
Restore database method for Microsoft SQL Server Desktop Engine on a Microsoft SQL Server having a different directory structure
- Copy the BlackBerry Configuration Database backup to the C:\ path of the new Microsoft SQL Server.
- From a command prompt, type osql -E and press Enter.
Note: When logging in to a named instance of the Microsoft SQL Server, use the following command: osql -E -S <SQL_Server_name>\<instance_name> - Type the following commands in the specified order:
- restore database <BlackBerry_Configuration_Database_name> from disk =
"C:\<BlackBerry_Configuration_Database_name>.bak" with move
"<BlackBerry_Configuration_Database_name>_data" to
"<new_path>\MSSQL\Data\<BlackBerry_Configuration_Database_name>.mdf", move
"<BlackBerry_Configuration_Database_name>_log" to "<new_path>\MSSQL\Data\<BlackBerry_Configuration_Database_name>.ldf"Note: To determine the logical file names <BlackBerry_Configuration_Database_name>_data and <BlackBerry_Configuration_Database_name>_log for the BlackBerry Configuration Database, complete the following steps:- On the Microsoft SQL Server hosting the BlackBerry Configuration Database, open a command prompt and type the following command:
OSQL -E or OSQL -E -S <SQL_Server_name>\<instance_name> - Type the following commands in the specified order, pressing Enter after each command:
exec sp_helpdb <BlackBerry_Configuration_Database_Name>
go
The two logical file names for the BlackBerry Configuration Database are BESMgmt_data and BESMgmt_log. - Close the command prompt.
- On the Microsoft SQL Server hosting the BlackBerry Configuration Database, open a command prompt and type the following command:
- go
- quit
- restore database <BlackBerry_Configuration_Database_name> from disk =
- Close the command prompt.
Detach and re-attach database method for Microsoft SQL Server Desktop Engine
- Open the Control Panel, and open Administrative Tools > Services.
- Stop each service that has a name that begins with BlackBerry.
- Log in to the existing MSDE Server.
- From a command prompt, type osql -E and press Enter.
Note: When logging in to a named instance of the Microsoft SQL Server, use the following command: osql -E -S <SQL_Server_name>\<instance_name> - Type the following commands in the specified order:
- exec sp_detach_db @dbname = "<BlackBerry_Configuration_Database_name>"
- go
- quit
- Go to the Microsoft SQL Server Data directory and copy the MDF and LDF files.
Note: The default path is C:\Program Files\Microsoft SQL Server\MSSQL\Data\ and the default filenames are BESMgmt.mdf and BESMgmt.ldf. - Move the files that were copied in step 6 to the new Microsoft SQL Server.
- Log in to the new MSDE Server.
- From a command prompt, type osql -E and press Enter.
Note: When logging in to a named instance of Microsoft SQL Server, use the following command: osql -E -S <SQL_Server_name>\<instance_name> - Type the following commands in the specified order:
- exec sp_detach_db @dbname = "<BlackBerry_Configuration_Database_name>"
- go
- quit
- Move the files that were copied in step 6 to the Microsoft SQL Server Data directory. When prompted to overwrite the files, click Yes.
- From a command prompt, type osql -E and press Enter.
Note: If logging in to a named instance of Microsoft SQL Server, use the following command syntax to log in: osql -E -S <SQL_Server_name>\<instance_name> - Type the following commands in the specified order:
- exec sp_attach_db @dbname = "<BlackBerry_Configuration_Database_name>"
- @filename1 = "C:\Program Files\Microsoft SQL Server\MSSQL\Data\<BlackBerry_Configuration_Database_name>.mdf",
- @filename2 = "C:\Program Files\Microsoft SQL Server\MSSQL\Data\<BlackBerry_Configuration_Database_name>.ldf"
- go
- quit
- Close the command prompt.
Task 4 - Configure the BlackBerry Enterprise Server
To configure the BlackBerry Enterprise Server to connect to the new BlackBerry Configuration Database, complete the following steps:
For BlackBerry Enterprise Server for Office 365
Note: BlackBerry Enterprise Server for Office 365 does not have a change database option like previous versions.
- Manually update the BESMgmt database with the new SQL instance name by running the following Transact-SQL command against the BESMgmt database:
UPDATE DatabaseServer SET Name = 'SQLServer\SQLInstance'
Where SQLServer\SQLInstance is the SQL server and SQL instance information for the new destination SQL server. - Then continue with following KB18129 that explains the configuration and connect process for BlackBerry Enterprise Server 5.0.
For BlackBerry Enterprise Server 5.0
BlackBerry Enterprise Server 5.0 does not have a change database option like previous versions. KB18129 explains the configuration and connect process for BlackBerry Enterprise Server 5.0.
For BlackBerry Enterprise Server 4.0 to 4.1
- On the BlackBerry Enterprise Server, click Start > Programs > BlackBerry Enterprise Server > BlackBerry Server Configuration.
- On the Database Connectivity tab, click Change Database.
- In the Change Database Wizard, specify the new Microsoft SQL Server name and the existing BlackBerry Configuration Database name.
- Complete the wizard. Make sure that the Start Services check box is selected and click Finish.
- Open Administrative Tools > Services and make sure that all of the BlackBerry Enterprise Server services started successfully.
Note: The BlackBerry Database Consistency Service might be unavailable, this is normal. - Open BlackBerry Manager and make sure that the correct database is set up by completing the following:
- For BlackBerry Enterprise Server 4.0
- Right-click BlackBerry Manager, and click Properties.
- Select the Properties tab and verify that the Microsoft SQL Server information and BlackBerry Configuration Database name are correct.
- For BlackBerry Enterprise Server 4.1
- Go to Tools > Options > Database and verify that the Microsoft SQL Server information and BlackBerry Configuration Database name are correct.
- Verify that all of the BlackBerry smartphone user accounts appear on BlackBerry Manager.
- If there is a remote BlackBerry Manager, make sure to check the settings from step 6.
- Test email message flow from the BlackBerry smartphone.
- For BlackBerry Enterprise Server 4.1, install the database notification system.
Note: This is only required in smaller environments running a maximum of 3 BlackBerry Enterprise Server instances. - Copy the RimEsp.dll file to the C:\Program Files\Microsoft SQL Server\MSSQL\Binn folder on the new Microsoft SQL Server.
- In Microsoft Query Analyzer, go to the Database\DBInstallScripts\SQLServer\4.1 folder on the installation media.
- Open the NotifyInstall.sql file and replace <_databasename> with the name of the BlackBerry Configuration Database.
- Run the script.
- For BlackBerry Enterprise Server 4.0
- Verify that the Microsoft Query Analyzer displays the following message: Function dbo.xp_RIM_xxxx registered
When moving from a Microsoft SQL Server Desktop Engine (MSDE) server instance to a full Microsoft SQL Server instance on a separate computer, see KB04039 for information on how to increase the mail agent limitation on the BlackBerry Enterprise Server.
If receiving an error that the BlackBerry Configuration Database is in use, complete the following steps:
- Remove all the BlackBerry smartphone user accounts from the BlackBerry Configuration Database by typing the following commands at a command prompt:
- OSQL -E
- use master
- alter database <BlackBerry_Configuration_Database_name> set single_user with rollback immediate
- go
- use <BlackBerry_Configuration_Database_name>
- go
- exit
- Detach the BlackBerry Configuration Database by typing the following commands at a command prompt:
- OSQL -E
- use master
- sp_detach_db @dbname = <BlackBerry_Configuration_Database_name>
- go
- exit
- Attach the BlackBerry Configuration Database by typing the following commands at a command prompt:
- OSQL -E
- use master
- exec sp_attach_db @dbname = "<BlackBerry_Configuration_Database_name>",
- @filename1 = "C:\<Path_to_database_file>\<BlackBerry_Configuration_Database_name>.mdf",
- @filename2 = "C:\<Path_to_transaction_log_file>\<BlackBerry_Configuration_Database_name>.ldf"
- go
- exit
Note: The default path is C:\Program Files\Microsoft SQL Server\MSSQL\Data and the default filenames are BESMgmt.mdf and BESMgmt.ldf.