Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Moving 2008 R2 db to 2012


Moving 2008 R2 db to 2012

Author
Message
rray 44280
rray 44280
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 165
I've got a database running on SQL Server 2008 R2 Standard. I'm building a SQL server 2012 Standard server to host a new version of that db. I want to move a copy of the database to the new server and run it under 2012 for testing for a couple of weeks, then move a fresh copy of the data to the new server when we're ready to go into production.

What's involved in detaching a database from a 2008 R2 instance and attaching it to a 2012 instance? I found some references to updating the compatibility level (to 110) and updating statistics. What else needs to be done?
Lokesh Vij
Lokesh Vij
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1564 Visits: 1599
Take a backup of the database on 2008R2, example shown below:

USE Master
GO
BACKUP DATABASE [SQLTraining]
TO DISK = N'D:\SQLTraining_FullBackup.bak' WITH NOFORMAT, NOINIT,
NAME = N'SQLTraining-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO



Restore the same on 2012 box

USE master
GO
RESTORE DATABASE [SQLTraining2012] FILE = N'SQLTraining'
FROM DISK = N'D:\SQLTraining_FullBackup.bak'
WITH FILE = 1,
MOVE N'SQLTraining'
TO N'D:\SQLTraining2012.mdf',
MOVE N'SQLTraining_log' TO N'D:\SQLTraining2012.LDF',
NOUNLOAD, STATS = 10
GO



This works like charm :-)

~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter


Lokesh Vij
Lokesh Vij
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1564 Visits: 1599
I re-read your post and found that you are actually looking for detaching and attaching the DB's. Here is the useful link http://msdn.microsoft.com/en-us/library/ms189625.aspx

Hope this helps!

~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter


dr.blowfin
dr.blowfin
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 244
Advisable to take a full backup of the source beforehand anyway :-D
rray 44280
rray 44280
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 165
I'm happy to do it via the backup and restore method, and that seems to be the approach I see discusse most often. Thanks!
dr.blowfin
dr.blowfin
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 244
rray 44280 (6/10/2013)
I'm happy to do it via the backup and restore method, and that seems to be the approach I see discusse most often. Thanks!


Well, detaching and attaching is a good option if you don't need to move the data and log files around the network. It's all a question of time. If it's quick enough to do a backup and restore then by all means take that approach.

Just make sure your backups are in order if you try doing the detach/attach. Not being a doomsayer, just advising caution wherever possible.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search