BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 03-12-2012, 08:57 AM   #1
OmahaAdam
New Member
 
Join Date: Mar 2012
Model: Curve
PIN: N/A
Carrier: Verizon
Posts: 3
Default SQL DB Migration

Please Login to Remove!

Hello All,

I am rather new to my organization where I replaced the previous BES admin so please forgive my n00bishness...

Backstory: BES 5.0.3, configured with some HA available on 2 servers(1vm 1physical). DB's are stored on seperate dedicated SQL cluster. My SQL cluster hardware is up for lease replacement this Qtr and I have 1 week to move my BES DBs to the new hardware. I have 3 db's on the cluser: besmgt, mdsis, bmsstore. The DB team wants to use DNS aliases in the future for all DB's so I will need to repoint from server\DB to alias\DB and then in future changes the alias will change in DNS and everything should be happy.

I have looked at a lot of documentation and nobody has really put a procedure or a post about doing this before.

I haven't really found a procedure for changing the bmsstore db or the mdsis db. Do I just re-install the app and tell the installation about my new alias\db name? This is all I have found for the mdsis db online but there has to be a better way.

Or do I go into the registry for the bmsstore db and change the server\db entries to alias\db?

How about the besmgt DB? Can I just change the registry settings or do I need to go through the install and point to alias\besmgt?

Keep in mind that I am creating the alias to point to my current DB server and then the night of the SQL cut-over I will stop all BB services and change my alias to point to new server where a backup and restored DB will be waiting.

Does this make sense at all and do you think it could work?

Thanks for your time!!
Adam
Offline  
Old 03-12-2012, 11:34 AM   #2
DarthBBerry
Wireless Sith Lord
 
DarthBBerry's Avatar
 
Join Date: Jan 2007
Location: Online
Model: iOS 6
Carrier: Verizon x2
Posts: 1,458
Default Re: SQL DB Migration

We just did something similar to this, but we also upgraded SQL from 2005 (on a physical server) to 2008 (on a VM)
Below is the procedure I wrote. Feel free to modify as you see fit.

All information attached is gleaned directly from BlackBerry Technical Solution Center

BTW - You don't need the MDSIS database if you're running BES 5.0.3.
KB25012-"Upgrade Issues" prompt appears when upgrading to BlackBerry Enterprise Server 5.0 SP3

****
SQL 2005 to SQL 2008 R2 VM
The BlackBerry® Enterprise Server services must be stopped during the process described in this article.
To move the BlackBerry Configuration Database to a new Microsoft® SQL Server® instance, complete the following tasks:
  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 to 2008[LIST=1][*]Open 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 Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008) when the process is complete.[\list]
________________________________________
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 or 2008 requires the following server role permissions: System Administrator, Database Creator.
Microsoft SQL Server 2000 to 2008
  1. Open Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008).
  2. Go to Microsoft Server Group > <SQL_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.
  8. Close Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008).
Step 2
Depending on the environment, turn on the correct server protocols.
Microsoft SQL Server 2008 Express or Microsoft SQL Server 2008
  1. Click Start > Microsoft SQL Server 2008 > Configuration Tools > SQL Server Configuration Manager.
  2. Expand SQL Server Network Configuration.
  3. Select the Microsoft SQL Server instance that will be used for the BlackBerry Configuration Database.
  4. If necessary, turn on the TCP/IP and Named Pipes protocols.
  5. If a protocol is turned on in the previous step, restart the Microsoft SQL Server services.
Step 3
Make sure that the Microsoft Server Agent service is running.
  1. Open the Windows® Control Panel, then open Administrative Tools > Services.
  2. Make sure 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.
KB03640-How to upgrade a remote BlackBerry Configuration Database
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.
    1. Go to the Database folder and open the BESMgmt.cfg file in a text editor, such as Notepad.
    2. 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.
    3. If using a named instance of Microsoft SQL Server, change the SERVER=local line to SERVER=<SQL_Server_Name>\<instance_name> and close the file. Save the changes.
    4. From a command prompt, go to the Database directory.
    5. Type createdb.exe BESMgmt.cfg and press Enter.
    6. 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.
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>.b ak" with move "<BlackBerry_Configuration_Database_name>_data " to "<new_path>\MSSQL\Data\<BlackBerry_Configuration_D atabase_name>.mdf", move "<BlackBerry_Configuration_Database_name>_log" to "<new_path>\MSSQL\Data\<BlackBerry_Configuration_D atabase_name>.ldf"
2> go
3> 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. Close the command prompt.
Restore database method for Microsoft SQL Server 2000 to 2008
  1. Open Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008).
  2. Right-click the Databases (for example, BESMgmt).
  3. Select Tasks>Restore Database.
  4. Click From Device and browse for the .bak file.
  5. Select Options and ensure Overwrite the existing database is checked.
  6. Click OK to accept selection.
  7. Close Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008) when the process is complete.
Detach and re-attach database method for Microsoft SQL Server 2000 to 2008
  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 Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008).
  5. Right-click the BlackBerry Configuration Database name.
  6. Select Tasks and click Detach.
  7. Close Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008).
  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 Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008).
  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.
  15. When prompted to overwrite the files, click Yes.
  16. In Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008), right-click the Database folder, then click All Tasks.
  17. Right-click the Database folder and select Attach.
  18. Select the MDF file to attach, then click OK (see screen shot below).
  19. Close Microsoft SQL Server Management Studio (Microsoft SQL Server 2005 or 2008).
________________________________________
Task 4 - Configure the BlackBerry Enterprise Server
For BlackBerry Enterprise Server 5.0
BlackBerry Enterprise Server 5.0 does not have a change database option like previous versions. KB18129 explains the process for BlackBerry Enterprise Server 5.0.
It is best practice when moving the BlackBerry Configuration Database to shut down all services pointing to the existing database before taking a full database backup to minimize any data loss during the move. The createdb utility can be used to create a blank database in the new location so the database server will have the required information about the new database. Once the blank database is created, a full database restore must be performed.
To configure the BlackBerry Enterprise Server to use a new BlackBerry Configuration Database or a new database server, run the setup.exe again by following the steps below:
  1. Run Setup.exe from the source installation folder. By default, the location is <drive>:\Research In Motion\BlackBerry Enterprise Server 5.0 or <drive>:\Research In Motion\BlackBerry Enterprise Server 5.0.x
  2. Accept the License Agreement and click Next.
  3. On the Database Information Screen, update the Database server information with the new Microsoft® SQL Server® name and BlackBerry Configuration Database name, select the type of authentication and choose Next.
  4. Close the installer.
  5. Restart all the BlackBerry Services.
  6. Repeat these steps on any remote nodes of the BlackBerry Administration Server, BlackBerry® Mobile Data System Connection Service, and BlackBerry Monitoring Server.
Note: After the setup has completed and the services restarted, message flow and organizer data synchronization will continue as usual. No interaction is required by the BlackBerry smartphone users. Additional BlackBerry Enterprise servers can be configured to point to the new database once the services are started on the first server.
Please see KB23428 if xxx8220;Error initializing systemxxx8221; error appears when starting BlackBerry Enterprise Server 5.0 SP2 and 5.0 SP3 setup.

Links and Resources
KB03112-How to move the BlackBerry Configuration Database to a new Microsoft SQL Server instance
KB03640-How to upgrade a remote BlackBerry Configuration Database
KB18129-How to point to a new BlackBerry Configuration Database in BlackBerry Enterprise Server 5.0
KB23428-xxx8220;Error initializing systemxxx8221; error appears when starting BlackBerry Enterprise Server 5.0 SP2 and 5.0 SP3 setup
__________________
DarthBBerry
6-Time BlackBerry World Champion (2007-2012)
BlackBerry® Certified Support Specialist v5.0
BlackBerry® Certified System Administrator v5.0

Last edited by DarthBBerry; 03-12-2012 at 11:37 AM.. Reason: Cause formatting is teh sux...
Offline  
Old 03-13-2012, 04:35 PM   #3
OmahaAdam
New Member
 
Join Date: Mar 2012
Model: Curve
PIN: N/A
Carrier: Verizon
Posts: 3
Default Re: SQL DB Migration

Excelent news about mdsis!

So if I am reading everything correctly all I have to do is run the BB setup and specify the new DB name. This is way easier than I thought it would be.
Offline  
Old 03-15-2012, 11:51 AM   #4
DarthBBerry
Wireless Sith Lord
 
DarthBBerry's Avatar
 
Join Date: Jan 2007
Location: Online
Model: iOS 6
Carrier: Verizon x2
Posts: 1,458
Default Re: SQL DB Migration

Yep yep. Just be sure that you have made a backup of the DB and restored it in the new destination location.
Then run setup.exe
__________________
DarthBBerry
6-Time BlackBerry World Champion (2007-2012)
BlackBerry® Certified Support Specialist v5.0
BlackBerry® Certified System Administrator v5.0
Offline  
Closed Thread


Thread Tools

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 Off

Forum Jump

Similar Threads for: SQL DB Migration
Thread Thread Starter Forum Replies Last Post
Knowledge Sharing - List of SQL Server Versions noname BES Admin Corner 2 02-20-2010 06:01 PM
Local Database Connection Error ogaal BES Admin Corner 10 11-25-2009 02:05 AM
Fresh Install 5.0 Remote SQL Error dvine RIM Software 0 10-12-2009 04:44 AM
BES upgrade to 4.1.6 Horsebox BES Admin Corner 3 08-05-2008 06:27 PM
DB Upgrade Failed. Error Executing SQL statement SimonMac BES Admin Corner 18 09-27-2007 08:03 AM


New Siemens 6ES7315-2EH14-0AB0 Simatic 6ES7 315-2EH14-0AB0 Expedited Shipping picture

New Siemens 6ES7315-2EH14-0AB0 Simatic 6ES7 315-2EH14-0AB0 Expedited Shipping

$1425.00



NEW SIEMENS 6SL3100-0BE25-5AB0 6SL3 100-0BE25-5AB0 S120 ACTIVE INTERFACE MODULE picture

NEW SIEMENS 6SL3100-0BE25-5AB0 6SL3 100-0BE25-5AB0 S120 ACTIVE INTERFACE MODULE

$3498.00



Siemens Sinamics G120C Siemens 6SL3210-1KE23-2AF1 15KW new original sealed picture

Siemens Sinamics G120C Siemens 6SL3210-1KE23-2AF1 15KW new original sealed

$999.00



New In Box Siemens 6SL3130-6AE21-0AB1 SINAMICS S120 Module 6SL3 130-6AE21-0AB1 picture

New In Box Siemens 6SL3130-6AE21-0AB1 SINAMICS S120 Module 6SL3 130-6AE21-0AB1

$950.00



1Pcs New in box Siemens 6SL3244-0BA21-1PA0 6SL3 244-0BA21-1PA0 PLC Module picture

1Pcs New in box Siemens 6SL3244-0BA21-1PA0 6SL3 244-0BA21-1PA0 PLC Module

$779.00



New In Box Siemens 6GK7343-1EX30-0XE0 6GK7 343-1EX30-0XE0 picture

New In Box Siemens 6GK7343-1EX30-0XE0 6GK7 343-1EX30-0XE0

$360.00







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.