Link to home
Start Free TrialLog in
Avatar of Todd Mostowy
Todd MostowyFlag for United States of America

asked on

BlackBerry Ent Server - Move DB

My BES Server has SQL 2005 installed.  I want to move the database from this server to our SQL Cluster which is 2008.  Below the line is what I found at the BB site, but I need more help.  There is no Management Studio and I am not a SQL person....  Please help me.

--------------------------------------------

BACKUP DATABASE
If you are using a full Microsoft SQL Server, follow the steps below:
1.      Open Enterprise Manager.
2.      Right-click the BlackBerry Configuration Database (the default name is BESMgmt).
3.      Select Backup Database.
4.      Click Add to specify the Directory Name and File Name. Click OK to accept the settings.
5.      Click OK to perform the backup.
6.      Close Enterprise Manager.
If you are using a Microsoft SQL Server Desktop Engine (MSDE), follow the steps below:
1.      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>
2.      Type the following commands in the specified order: 1> backup database <database_name> to disk = "C:\<database_name>.bak"
2> go
1> quit
3.      Close the command prompt.
RESTORE the BlackBerry Configuration Database
Use one of the following methods to restore the BlackBerry Configuration Database:
Method 1 - Back up and Restore the BlackBerry Configuration Database (on an SQL Server with the same directory structure)
Complete the following steps:
1.      Copy the BlackBerry Configuration Database backup to the C:\ path of the new SQL Server.
2.      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>
3.      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
4.      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:
1.      Copy the BlackBerry Configuration Database backup to the C:\ path of the new SQL Server.
2.      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>
3.      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
4.      Close the command prompt.
Method 3 - Detach and Re-attach the BlackBerry Configuration Database
Perform the following steps:
Step 1 - Stop the BlackBerry Services
1.      Open the Windows Services. To do this, go to the Control Panel and open Administrative Tools>Services.
2.      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:
1.      Log in to the original SQL Server.
2.      Open Enterprise Manager.
3.      Right-click the BlackBerry Configuration Database.
4.      Select All Tasks and click Detach Database.
5.      Close Enterprise Manager.
6.      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.
7.      Move the file copies to the new SQL Server.
8.      Log in to the new SQL Server.
9.      Open Enterprise Manager.
10.      Right-click the BlackBerry Configuration Database.
11.      Select All Tasks and click Detach Database.
12.      Move the files you copied in step 6 into the SQL Data directory. When prompted to overwrite the files, click Yes.
13.      In Enterprise Manager, right-click the Database folder and click All Tasks.
14.      Select Attach Database.
15.      Select the MDF file to attach and click OK.
16.      Close Enterprise Manager.
If you are using MSDE, complete the following:
1.      Log in to the first MSDE Server.
2.      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>
3.      Type the following commands in the specified order: 1> exec sp_detach_db @dbname = "<database_name>"
2> go
1> quit
4.      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.
5.      Move the file copies to the new SQL Server.
6.      Log in to the new MSDE Server.
7.      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>
8.      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.
9.      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>
10.      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
11.      Close the command prompt.
ASKER CERTIFIED SOLUTION
Avatar of Ryan McCauley
Ryan McCauley
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Todd Mostowy

ASKER

I will try it this weekend.  Thank you!
Thank you for the help