Welcome to Port3101.org : Your BES Connection Mark forums read | View Forum Leaders
Port3101.org : Your BES Connection



Reply
LinkBack (13) Thread Tools Display Modes
KB03112 - How to move the BESMgmt Database to a new SQL Server or instance
 
  13 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 12-19-2008, 04:10 PM
hdawg's Avatar
Proprietor
 
Join Date: Nov 2008
Posts: 2,257
Blog Entries: 147
Default KB03112 - How to move the BESMgmt Database to a new SQL Server or instance

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

Environment

  • BlackBerry® Enterprise Server for IBM® Lotus® Domino® software version 2.1, 2.2, 4.0 and 4.1
  • BlackBerry® Enterprise Server for Microsoft® Exchange software versions 2.1, 3.6, 4.0, and 4.1
  • Microsoft® SQL Server® 2000 Service Pack 3 and 2005



Overview

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 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 appropriate steps for the environment:
Microsoft SQL Server 2000 or 2005
  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 (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005) 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 \
  2. Type the following commands in the specified order: 1> backup database to disk = "C:\.bak"
    2> go
    1> quit
  3. Close the command prompt.

Task 2 - Prepare the new Microsoft SQL Server

To prepare the Microsoft SQL Server, complete the following 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 2000 or 2005
  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 click Manage.
  3. Expand Local Users and Groups.
  4. Select Groups, and open the Administrators group.
  5. Click Add.
  6. Type the name of the BlackBerry Enterprise Server service account, and click Check Name.
  7. Click OK, and 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.
  2. Type svrnetcn.
  3. Click OK. The Microsoft Server Network Configuration Utility opens.
  4. Make sure that TCP/IP and Named Pipes are both listed as protocols that have been turned on.
  5. Close the Microsoft Server Network Configuration Utility.
  6. 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 Serverservices.
Step 3
Make sure that 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, 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 that is 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=\ 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. There are two methods available: restoring the BlackBerry Configuration Database from a backup, or detaching and re-attaching the BlackBerry Configuration Database files. The following are the steps for MSDE and Microsoft SQL Server 2000 and 2005.
Restore database method for MSDE
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 \
  3. Type the following commands in the specified order: 1> restore database from disk = "c:\.bak" with recovery, replace
    2> go
    1> 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 \
  3. Type the following commands in the specified order: 1> restore database from disk = "C:\.bak" with move "_data" to "<new_path>\MSSQL\Data\.mdf", move "_log" to "<new_path>\MSSQL\Data\.ldf"
    2> go
    1> quit
    Note: To determine the logical file names _data and _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.
Restore database method for Microsoft SQL Server 2000 or 2005
  1. Open Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005).
  2. Right-click the Databases (for example, BESMgmt).
  3. Select Restore Database.
  4. Click From Device and browse for the .bak file.
  5. Click OK to accept selection.
  6. Close Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005) when the process is complete.
Detach and re-attach database method for Microsoft SQL Server 2000 or 2005
  1. Open the Control Panel, and 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 (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005).
  5. Right-click the BlackBerry Configuration Database name.
  6. Select All Tasks, and click Detach Database (see screen shot below), or for Microsoft SQL Server 2005 select Tasks and click Detach.
  7. Close Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005).
  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 (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005).
  12. Right-click the BlackBerry Configuration Database name.
  13. Select All Tasks, then click Detach Database, or for Microsoft SQL Server 2005 select Tasks and click Detach.
  14. Move the files that were copied in step 8 to the Microsoft SQL Server Data directory.
  15. When prompted to overwrite the files, click Yes.
  16. In Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005), right-click the Database folder, then click All Tasks.
  17. Select Attach Database or for Microsoft SQL 2005 right-click the Database folder and select Attach.
  18. Select the MDF file to attach, then click OK (see screen shot below).
  19. Close Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005).

Detach and re-attach database method for MSDE
  1. Open the Control Panel, and 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 \
  5. Type the following commands in the specified order: 1> exec sp_detach_db @dbname = ""
    2> go
    1> 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 \
  10. Type the following commands in the specified order: 1> exec sp_detach_db @dbname = ""
    2> go
    2> quit
  11. Move the files that were copied in step 6 to 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 \
  13. Type the following commands in the specified order: 1> exec sp_attach_db @dbname = "",
    2> @filename1 = "C:\Program Files\Microsoft SQL Server\MSSQL\Data\.mdf",
    3> @filename2 = "C:\Program Files\Microsoft SQL Server\MSSQL\Data\.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. (see screen shot below)
  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 click Finish.
  5. 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.
  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, and 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 that all of 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. (see screen shot below)
  4. Run the script.
  5. Verify that the Microsoft Query Analyzer displays the following message:
    Function dbo.xp_RIM_xxxx registered.




Additional Information

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 -E

    1> use master

    2> alter database database_name set single_user with rollback immediate

    3> go

    1> use <database_name>

    2> go

    1> exit
  2. Detach the BlackBerry Configuration Database by typing the following commands at a command prompt:
    OSQL -E

    1> use master

    2> sp_detach_db @dbname = <database_name>

    3> go

    1> exit
  3. Attach the BlackBerry Configuration Database by typing the following commands at a command prompt:
    OSQL -E

    1> use master

    2> 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> go

    1> exit
__________________
http://blog.port3101.org/hdawg/
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-23-2008, 03:14 PM
Cheese Sammich's Avatar
Super Moderator
 
Join Date: Dec 2008
Location: Long Island
Posts: 232
Default

Be honest, Mr. E... you typed this whole thing out from memory, didn't you?
__________________
Reply With Quote
  #3 (permalink)  
Old 12-23-2008, 03:19 PM
hdawg's Avatar
Proprietor
 
Join Date: Nov 2008
Posts: 2,257
Blog Entries: 147
Default

With the exception of the Domino references ... yes
__________________
http://blog.port3101.org/hdawg/
Reply With Quote
  #4 (permalink)  
Old 01-12-2009, 11:48 AM
AUTiger92's Avatar
BES Expert
 
Join Date: Jan 2009
Location: Alabama
Posts: 82
Default

Ok, I'm not a SQL guy, in fact I probably know enough to be dangerous, but the instructions are pretty straight forward. I have two BESMgmt db on SQL 2000 and want to move them to SQL 2005. What if any additional steps would I need to do?
Reply With Quote
  #5 (permalink)  
Old 01-12-2009, 11:53 AM
hdawg's Avatar
Proprietor
 
Join Date: Nov 2008
Posts: 2,257
Blog Entries: 147
Default

That procedure actually works spot on as it is.

That said, I would highly recommend printing it out when you do a move, and cross off each thing as done when you do it. Skipping just 1 step or thinking it isn't needed in this procedure will yield a failure.

The two things that always seem to be forgotten are:

1) Task 2 Step 4 - Creating the shell database
2) Setting proper account permissions (the good thing about this one is you can just look how the other server is setup
__________________
http://blog.port3101.org/hdawg/
Reply With Quote
  #6 (permalink)  
Old 01-30-2009, 11:16 PM
Pelvir's Avatar
BES Administrator
 
Join Date: Jan 2009
Location: New Orleans, La
Posts: 27
Default

Quote:
Originally Posted by AUTiger92 View Post
Ok, I'm not a SQL guy, in fact I probably know enough to be dangerous, but the instructions are pretty straight forward. I have two BESMgmt db on SQL 2000 and want to move them to SQL 2005. What if any additional steps would I need to do?

I have had the same exact question for 2 months... Finally got a clear answer!

Mr. E - Thank you sir, you are awesome. I am a relatively new BES admin and need to migrate from an older SQL2000/BES 4.1.2.25 configuration to a new server with SQL2005 and upgrade to the latest BES.

One question. Should I upgrade to the latest BES on the older server then move? From what I have read on other forums you should move the BES from the same version to the same version.

Thanks in advance and thanks to the peeps that put this site together!!
Reply With Quote
  #7 (permalink)  
Old 04-01-2009, 02:51 PM
hdawg's Avatar
Proprietor
 
Join Date: Nov 2008
Posts: 2,257
Blog Entries: 147
Default

updated.
__________________
http://blog.port3101.org/hdawg/
Reply With Quote
  #8 (permalink)  
Old 05-26-2009, 01:00 PM
hdawg's Avatar
Proprietor
 
Join Date: Nov 2008
Posts: 2,257
Blog Entries: 147
Default

*Updated*


Environment

  • BlackBerry® Enterprise Server for IBM® Lotus® Domino® software version 2.1, 2.2, and 4.0 - 4.1
  • BlackBerry® Enterprise Server for Microsoft® Exchange software versions 2.1, and 3.6 - 4.1
  • Microsoft® SQL Server® 2000 Service Pack 3 and 2005



Overview

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 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 appropriate steps for the environment:
Microsoft SQL Server 2000 or 2005
  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 (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005) 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 \
  2. Type the following commands in the specified order: 1> backup database to disk = "C:\.bak"
    2> go
    1> quit
  3. Close the command prompt.

Task 2 - Prepare the new Microsoft SQL Server

To prepare the Microsoft SQL Server, complete the following 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 2000 or 2005
  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 click Manage.
  3. Expand Local Users and Groups.
  4. Select Groups, and open the Administrators group.
  5. Click Add.
  6. Type the name of the BlackBerry Enterprise Server service account, and click Check Name.
  7. Click OK, and 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.
  2. Type svrnetcn.
  3. Click OK. The Microsoft Server Network Configuration Utility opens.
  4. Make sure that TCP/IP and Named Pipes are both listed as protocols that have been turned on.
  5. Close the Microsoft Server Network Configuration Utility.
  6. 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 Serverservices.
Step 3
Make sure that 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, 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 that is being used.
  2. Extract the contents of the installation package.
  3. 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.
  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=\ 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. There are two methods available: restoring the BlackBerry Configuration Database from a backup, or detaching and re-attaching the BlackBerry Configuration Database files. The following are the steps for MSDE and Microsoft SQL Server 2000 and 2005.
Restore database method for MSDE
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 \
  3. Type the following commands in the specified order: 1> restore database from disk = "c:\.bak" with recovery, replace
    2> go
    1> 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 \
  3. Type the following commands in the specified order: 1> restore database from disk = "C:\.bak" with move "_data" to "<new_path>\MSSQL\Data\.mdf", move "_log" to "<new_path>\MSSQL\Data\.ldf"
    2> go
    1> quit
    Note: To determine the logical file names _data and _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.
Restore database method for Microsoft SQL Server 2000 or 2005
  1. Open Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005).
  2. Right-click the Databases (for example, BESMgmt).
  3. Select Restore Database.
  4. Click From Device and browse for the .bak file.
  5. Click OK to accept selection.
  6. Close Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005) when the process is complete.
Detach and re-attach database method for Microsoft SQL Server 2000 or 2005
  1. Open the Control Panel, and 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 (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005).
  5. Right-click the BlackBerry Configuration Database name.
  6. Select All Tasks, and click Detach Database (see screen shot below), or for Microsoft SQL Server 2005 select Tasks and click Detach.
  7. Close Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005).
  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 (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005).
  12. Right-click the BlackBerry Configuration Database name.
  13. Select All Tasks, then click Detach Database, or for Microsoft SQL Server 2005 select Tasks and click Detach.
  14. Move the files that were copied in step 8 to the Microsoft SQL Server Data directory.
  15. When prompted to overwrite the files, click Yes.
  16. In Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005), right-click the Database folder, then click All Tasks.
  17. Select Attach Database or for Microsoft SQL 2005 right-click the Database folder and select Attach.
  18. Select the MDF file to attach, then click OK (see screen shot below).
  19. Close Enterprise Manager (Microsoft SQL Server 2000) or Microsoft SQL Server Management Studio (Microsoft SQL Server 2005).

Detach and re-attach database method for MSDE
  1. Open the Control Panel, and 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 \
  5. Type the following commands in the specified order: 1> exec sp_detach_db @dbname = ""
    2> go
    1> 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 \
  10. Type the following commands in the specified order: 1> exec sp_detach_db @dbname = ""
    2> go
    2> quit
  11. Move the files that were copied in step 6 to 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 \
  13. Type the following commands in the specified order: 1> exec sp_attach_db @dbname = "",
    2> @filename1 = "C:\Program Files\Microsoft SQL Server\MSSQL\Data\.mdf",
    3> @filename2 = "C:\Program Files\Microsoft SQL Server\MSSQL\Data\.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. (see screen shot below)
  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 click Finish.
  5. 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.
  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, and 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 that all of 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. (see screen shot below)
  4. Run the script.
  5. Verify that the Microsoft Query Analyzer displays the following message:
    Function dbo.xp_RIM_xxxx registered.




Additional Information

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 -E

    1> use master

    2> alter database database_name set single_user with rollback immediate

    3> go

    1> use <database_name>

    2> go

    1> exit
  2. Detach the BlackBerry Configuration Database by typing the following commands at a command prompt:
    OSQL -E

    1> use master

    2> sp_detach_db @dbname = <database_name>

    3> go

    1> exit
  3. Attach the BlackBerry Configuration Database by typing the following commands at a command prompt:
    OSQL -E

    1> use master

    2> 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> go

    1> exit

    Note:
    The default path is C:\Program Files\Microsoft SQL Server\MSSQL\Data\ and the default filenames are BESMgmt.mdf and BESMgmt.ldf.
__________________
http://blog.port3101.org/hdawg/
Reply With Quote
  #9 (permalink)  
Old 01-11-2010, 03:06 PM
BES Activated
 
Join Date: May 2009
Location: LA
Posts: 3
Default

thank you for your hard work!
Reply With Quote
  #10 (permalink)  
Old 03-11-2010, 01:49 AM
BES Activated
 
Join Date: Mar 2010
Posts: 2
Default

Is there an updated one of these for BES v5?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://www.port3101.org/featured-blackberry-kb-articles/133-kb03112-how-move-besmgmt-database-new-sql-server-instance.html
Posted By For Type Date
Przenoszenie bazy danych na inny serwer - BES 5,0 - BlackBerry Support Community Forum This thread Refback 01-11-2013 11:17 AM
massivearrow This thread Refback 10-19-2012 11:11 AM
glowingcircle This thread Refback 10-18-2012 06:19 PM
swirlyportal This thread Refback 08-16-2012 11:51 AM
notepad This thread Refback 06-28-2012 06:44 PM
EVGA 01G-P3-N945-LR GeForce 9400 GT 1GB DDR2 PCI-E 2.0 Graphics Card This thread Refback 06-25-2012 07:48 PM
404 Not Found This thread Refback 06-15-2012 01:01 PM
BES AD Domain Migration This thread Refback 05-11-2011 11:31 PM
Move database to another server - BES 5.0 - BlackBerryForums.com : Your Number One BlackBerry Community This thread Pingback 08-06-2009 08:56 PM
New BES Server / New Hardware - BlackBerryForums.com : Your Number One BlackBerry Community This thread Refback 06-29-2009 10:54 PM
Moving to new BPS - BlackBerryForums.com : Your Number One BlackBerry Community This thread Pingback 06-18-2009 09:51 AM
BES SQL Server Replacement and Upgrade Process - BlackBerryForums.com : Your Number One BlackBerry Community This thread Pingback 06-17-2009 09:48 PM
BES 5.0 Traitool - BlackBerryForums.com : Your Number One BlackBerry Community This thread Pingback 06-11-2009 08:03 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing an SQL Besmgmt database over the top arthurlandry Port 3101: The BES Admin Bar & Grill 0 04-27-2010 03:58 PM
BESMgmt SQL Database Mirroring mahoward Port 3101: The BES Admin Bar & Grill 7 03-05-2010 06:29 PM
KB12247 - Move from an MSDE database to a Microsoft SQL Server database hdawg Featured BlackBerry KB Articles 2 09-24-2009 04:25 PM
KB03543 - Unable to open BESMgmt database hdawg Featured BlackBerry KB Articles 0 09-24-2009 04:24 PM
KB17627 - How to create a new Microsoft SQL Server Desktop Engine database instance hdawg Featured BlackBerry KB Articles 0 05-26-2009 12:03 PM


All times are GMT -4. The time now is 09:53 PM.
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.


 

SEO by vBSEO 3.3.2 PL2