Solved

SQL 2008 Database Move

Posted on 2012-12-21
10
161 Views
Last Modified: 2013-01-21
SQL 2008
Server 2003

I have built a new Microsoft Server 2008 R2 SP1ready to install SQL 2008.

First thing in the New Year I am going to do the following.

Migrate several of my SQL Database from one server to another.

This will end up having two SQL servers, the old one I will decommission in a few months.

What method do you experts recommend?

And any tips and tricks and best practice to installing SQL 2008 the way the Pro's do it?
0
Comment
Question by:Bransby-IT
  • 4
  • 4
  • 2
10 Comments
 
LVL 68

Accepted Solution

by:
Qlemo earned 350 total points
ID: 38712934
There are two common methods used:

detach - copy - attach: Detach the DB on old server, copy the data and log files to the new server, and attach them there, providing the new paths if changed. You can do both detach and attach with SSMS.

backup - (copy -) restory: Create a full DB backup, and restore it to the new server. This is best done via T-SQL.

You'll have to make sure you'll recreate the SQL Logins, if any, prior to any other operations, and to revalidate DB Users on the new server for each DB and user with
  exec sp_change_users_login 'Update_One', «dbuser1», «dbuser1»
(executed in each DB).
0
 
LVL 3

Author Comment

by:Bransby-IT
ID: 38713029
So both SA accounts have to have the same username and passwords?
The server names will have changed so I know I will have to let the clients know.

I was kind of swayed to detach the database.   The SQL install directory can change yes?
0
 
LVL 26

Expert Comment

by:Zberteoc
ID: 38713123
Is the old server the same version? If the old server is of an earlier version you have the choice to keep or change the compatibility level. There is also a advisor that can help with this kind of migration:

http://www.microsoft.com/en-us/download/details.aspx?id=11455

Do you have any SQL jobs setup on the old server? If yes you will need to move them as well.
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 38713128
You can change directories as you see fit, for each file individually.

Passwords are stored in the SQL Server's master DB, and can be different. User names need to be the same.
0
 
LVL 26

Expert Comment

by:Zberteoc
ID: 38713136
If you detach and attach the files you don't have to do anything with the location. Just move the files in the folder where you want to keep them on the new server. Database doesn't even has to exist on the new server.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Author Comment

by:Bransby-IT
ID: 38713153
Great stuff, well I have just got the server ready to install SQL 2008, after the install I need to apply any patches ect.   Which is my best option for this?
0
 
LVL 3

Author Comment

by:Bransby-IT
ID: 38713157
Thanks for your help team.   Back in the New Year!
Merry Christmas.......
0
 
LVL 26

Assisted Solution

by:Zberteoc
Zberteoc earned 150 total points
ID: 38713165
Install the SQL server 2008 R2 and after finish just run s windows update and it will pick up any necessary patches and updates.
0
 
LVL 3

Author Comment

by:Bransby-IT
ID: 38740534
by: ZberteocPosted on 2012-12-21 at 14:47:05ID: 38713123
Rank: Sage
Do you have any SQL jobs setup on the old server? If yes you will need to move them as well.


When you say this what do you mean?   How can I tell?
0
 
LVL 26

Expert Comment

by:Zberteoc
ID: 38801776
If you expand the SQLAgent node > Jobs > Right Ckick on the job, if there are any > Properties and then in the windows that opens check the steps details and see if any of them are executed against the database you need to move. If yes then you will help to recreate the jobs on the other server. You can actually script them out.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ssms - object execution statistics 12 37
Shop sales Actual vs Forecast 2 26
separate column 24 20
SQL Script to find duplicates 16 19
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now