How to move the BlackBerry Configuration Database to a new Microsoft SQL Server or instance

Environment

  • BlackBerry® Enterprise Server software version 2.1 through 4.1 for Microsoft® Exchange
  • BlackBerry® Enterprise Server software version 2.1 through 4.1 for IBM® Lotus® Domino®
  • Microsoft® SQL Server™ 2000 Service Pack 3
  • Microsoft® SQL Server™ 2005

    Procedure

    The BlackBerry Enterprise Server services must be stopped during the process described in this article.

    Important: Restarting certain BlackBerry Enterprise Server services will delay email message delivery to BlackBerry smartphones. For more information, see KB04789.

    To move the BlackBerry Configuration Database to a new Microsoft SQL Server or instance, complete the following tasks:

    Note: In a Microsoft Exchange environment, complete the tasks using the BlackBerry Enterprise Server service account unless otherwise stated.

    1. Back up the BlackBerry Configuration Database.
    2. Prepare the new Microsoft SQL Server.
    3. Restore the BlackBerry Configuration Database.
    4. Configure the BlackBerry Enterprise Server.

    Task 1 – Back up the BlackBerry Configuration Database

    To back up the BlackBerry Configuration Database, complete the steps for the appropriate environment.

    Microsoft SQL Server

    1. Open Enterprise Manager (Microsoft SQL Server 2000) or Microsoft® SQL Server Management Studio (Microsoft SQL Server 2005).
    2. Right-click the BlackBerry Configuration Database (for example, BESMgmt).
    3. Select Backup Database.
    4. Click Add to specify the Directory Name and File Name.
    5. Click OK to accept the settings.
    6. Click OK again to start the backup process.
    7. Close Enterprise Manager when the process is complete.

    Microsoft SQL Server Desktop Engine (MSDE)

    1. From a command prompt, type osql -E and press ENTER.Note: If you are logging in to a named instance of the Microsoft SQL Server, use the following command syntax to log in:

      osql -E -S <Microsoft_Server_name>\<instance_name>

    2. Type the following commands in the specified order:1> backup database <BlackBerry_Configuration_Database_name> to disk = “C:\<BlackBerry_Configuration_Database_name>.bak”2> go1> quit
    3. Close the command prompt.

    Task 2 – Prepare the new Microsoft SQL Server

    To prepare the Microsoft SQL Server, complete the following four steps:

    Step 1

    Depending on the environment, assign the appropriate permissions.

    Note: Complete this task using an account with administrator access to the new Microsoft SQL Server. Microsoft SQL Server 2005 requires the following server role permissions: System Administrator, Database Creator.

    Microsoft SQL Server

    1. Open Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005).
    2. Go to Microsoft Server Group > <Microsoft_Server_name> > Security.
    3. Right-click Logins and select New Login.
    4. From the General tab, click the double quotation marks ( “” ) button.
    5. From the Global Address List, select the name of the BlackBerry Enterprise Server service account.
    6. Click Add, then click OK.
    7. On the Server Roles tab, select Server Administrators and Database Creators.Note: In BlackBerry Enterprise Server software version 4.1, the System Administrator role is needed for role-based administration.
    8. Close Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005).

    MSDE

    1. Log in to the new Microsoft SQL Server.
    2. Right-click My Computer, and then click Manage.
    3. Expand Local Users and Groups.
    4. Select Groups, and then open the Administrators group.
    5. Click Add.
    6. Type the name of the BlackBerry Enterprise Server service account, and then click Check Name.
    7. Click OK, and then close the Computer Management window.

    Step 2

    Depending on the environment, turn on the correct server protocols.

    MSDE or Microsoft SQL Server 2000

    1. Click Start > Run, type svrnetcn and click OK. The Microsoft Server Network Configuration Utility opens.
    2. Make sure that TCP/IP and Named Pipes are both listed as protocols that have been turned on.
    3. Close the Microsoft Server Network Configuration Utility.
    4. If a protocol is turned on in step 2, restart the Microsoft SQL services.

    Microsoft SQL Server 2005 Express or Microsoft SQL Server 2005

    1. Click Start > Microsoft SQL Server 2005 > Configuration Tools > Microsoft Server Configuration Manager > Microsoft Server 2005 Network Configuration.
    2. Select the Microsoft SQL Server instance that will be used for the BlackBerry Configuration Database.
    3. If necessary, turn on the TCP/IP and Named Pipes protocols.
    4. If a protocol is turned on in the previous step, restart the Microsoft SQL services.

    Step 3

    Make sure the Microsoft Server Agent service is running.

    Note: This service does not exist in Microsoft SQL Server 2005 Express.

    1. Open the Windows® Control Panel, and then open Administrative Tools > Services.
    2. Verify that the Microsoft Server Agent service is started and that the Startup type is set to Automatic.
    3. 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 task because the schema has already been updated.

    1. Download the installation package for the version of the BlackBerry Enterprise Server being used.
    2. Extract the contents of the installation package.
    3. Copy the Database folder to the new Microsoft SQL Server.
    4. Go to the Database folder and open the BESMgmt.cfg file in a text editor, such as Notepad.
    5. Locate the DB_NAME=BESMgmt line and make sure that the name specified matches the BlackBerry Configuration Database name.
    6. If you are using a named instance of Microsoft SQL Server, change the SERVER=local line to SERVER=<Microsoft_Server_Name>\ <instance_name> and close the file. Save the changes.
    7. From a command prompt, go to the Database directory.
    8. Type createdb.exe BESMgmt.cfg and press ENTER.
    9. After the command has finished executing, close the command prompt.

    Task 3 – Restore the BlackBerry Configuration Database

    Depending on the environment, use one of the methods below to restore the BlackBerry Configuration Database.

    BlackBerry Configuration Database on a Microsoft SQL Server with the same directory structure

    1. Copy the BlackBerry Configuration Database backup to the C:\ path of the new Microsoft SQL Server.
    2. 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>

    3. Type the following commands in the specified order:1> restore database <BlackBerry_Configuration_Database_name> from disk = “c:\<BlackBerry_Configuration_Database_name>.bak” with recovery, replace2> go1> quit
    4. Close the command prompt.

    BlackBerry Configuration Database on a Microsoft SQL Server with a different directory structure

    1. Copy the BlackBerry Configuration Database backup to the C:\ path of the new Microsoft SQL Server.
    2. 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>

    3. Type the following commands in the specified order:1> 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”2> go1> quit

      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:

      1. 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>
      2. Type the following commands in the specified order, pressing ENTER after each command:1>exec sp_helpdb <BlackBerry_Configuration_Database_Name>2> go
      3. The items circled in the following image are the two logical file names for the BlackBerry Configuration Database:
      4. Close the command prompt.

    Detach and re-attach the BlackBerry Configuration Database

    Depending on the environment, complete one of the procedures below.

    Microsoft SQL Server

    1. Open the Control Panel, and then open Administrative Tools > Services.
    2. Stop each service that has a name that begins with BlackBerry.
    3. Log in to the existing Microsoft SQL Server.
    4. Open Enterprise Manager.
    5. Right-click the BlackBerry Configuration Database name.
    6. Select All Tasks, and then click Detach Database.
    7. Close Enterprise Manager.
    8. 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.
    9. Move the file copies to the new Microsoft SQL Server.
    10. Log in to the new Microsoft SQL Server.
    11. Open Enterprise Manager.
    12. Right-click the BlackBerry Configuration Database name.
    13. Select All Tasks, then click Detach Database.
    14. Move the files that were copied in step 8 to the Microsoft SQL Server Data directory. When prompted to overwrite the files, click Yes.
    15. In Enterprise Manager, right-click the Database folder, then click All Tasks.
    16. Select Attach Database.
    17. Select the MDF file to attach, then click OK.
    18. Close Enterprise Manager.

    MSDE

    1. Open the Control Panel, and then open Administrative Tools > Services.
    2. Stop each service that has a name that begins with BlackBerry.
    3. Log in to the existing MSDE Server.
    4. 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>

    5. Type the following commands in the specified order:1> exec sp_detach_db @dbname = “<BlackBerry_Configuration_Database_name>2> go1> quit
    6. 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.
    7. Move the files that were copied in step 6 to the new Microsoft SQL Server.
    8. Log in to the new MSDE Server.
    9. 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>

    10. Type the following commands in the specified order:1> exec sp_detach_db @dbname = “<BlackBerry_Configuration_Database_name>2> go2> quit
    11. Move the files that were copied in step 6 into the Microsoft SQL Server Data directory. When prompted to overwrite the files, click Yes.
    12. From a command prompt, type osql -E and press ENTER.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 <SQL_Server_name>\<instance_name>

    13. Type the following commands in the specified order:1> exec sp_attach_db @dbname = “<BlackBerry_Configuration_Database_name>“,2> @filename1 = “C:\Program Files\Microsoft SQL Server\MSSQL\Data\<BlackBerry_Configuration_Database_name>.mdf”,3> @filename2 = “C:\Program Files\Microsoft SQL Server\MSSQL\Data\<BlackBerry_Configuration_Database_name>.ldf”

      4> go

      1> quit

    14. 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:

    1. On the BlackBerry Enterprise Server, click Start > Programs > BlackBerry Enterprise Server > BlackBerry Server Configuration.
    2. On the Database Connectivity tab, select Change Database.
    3. In the Change Database Wizard, specify the new Microsoft SQL Server name and the existing BlackBerry Configuration Database name.
    4. Continue with the wizard. Make sure that the Start Services check box is selected, and then click Finish.
    5. Open Administrative Tools > Services and make sure all the BlackBerry Enterprise Server services started successfully.Note: The BlackBerry Database Consistency Service may be disabled. This is normal behavior.
    6. Open BlackBerry Manager and make sure that the correct database is set up by completing the following:For BlackBerry Enterprise Server software version 4.0
      1. Right-click BlackBerry Manager, select Properties.
      2. Select the Properties tab and verify that the Microsoft SQL Server information and BlackBerry Configuration Database name are correct.

      For BlackBerry Enterprise Server software version 4.1

      1. Go to Tools > Options > Database and verify that the Microsoft SQL Server information and BlackBerry Configuration Database name are correct.
      2. Verify all the BlackBerry smartphone user accounts appear on BlackBerry Manager.
    7. If you have a remote BlackBerry Manager, make sure to check the settings from step 6.
    8. Test email message flow from the BlackBerry smartphone.

    For BlackBerry Enterprise Server software version 4.1, install the database notification system.

    1. Copy the RimEsp.dll file to the C:\Program Files\Microsoft SQL Server\MSSQL\Binn folder on the new Microsoft SQL Server.
    2. In Microsoft Query Analyzer, go to the Database\DBInstallScripts\SQLServer\4.1 folder on the installation media.
    3. Open the NotifyInstall.sql file and replace <_databasename> with the name of the BlackBerry Configuration Database.
    4. Run the script.
    5. Confirm that the Microsoft Query Analyzer displays the following message:

      Function dbo.xp_RIM_xxxx registered.


    Additional Info

    When moving from an 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 you receive an error that the BlackBerry Configuration Database is in use, complete the following steps:

    1. Remove all the BlackBerry smartphone user accounts from the BlackBerry Configuration Database by typing the following commands at a command prompt:

      OSQL -E1> use master2> alter database database_name set single_user with rollback immediate3> go1> use <database_name>2> go1> exit

    2. Detach the BlackBerry Configuration Database by typing the following commands at a command prompt:

      OSQL -E1> use master2> sp_detach_db @dbname = <database_name>3> go1> exit

    3. Attach the BlackBerry Configuration Database by typing the following commands at a command prompt:

      OSQL -E1> use master2> exec sp_attach_db @dbname = “<database_name>”,3> @filename1 = “C:\<Path_to_database_file>\<database_name>.mdf”,4> @filename2 = “C:\<Path_to_transaction_log_file>\<database_name>.ldf”5> go1> exit

Advertisements

1 Comment »

  1. prom1 said

    Nice right up! I may be needing this in a few months > until then I dont’ have access to the BES where I work now. In time I’m sure I will as I’ve worked with BES via Citrix connection before with Jr BES Amin access.

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: