Solved

migrating sql databases to new server

Posted on 2014-09-08
6
116 Views
Last Modified: 2014-12-09
I have 2 SQL servers running Windows 2003 and SQL 2005.  The user accounts and SA (I dont know what the SA passwords are, someone long time ago did the installs and didnt document them) on the existing 2 servers are different.  I have a new server running Windows 2012 R2 and am installing SQL 2008 R2 w/SP2.  Trying to find some documentation/steps to migrate the databases on SQL servers 1 and 2 to the new SQL server.

The applications using the SQL databases are:  MIP eSite and Raiser's Edge.
0
Comment
Question by:supprteng
6 Comments
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 40311785
You have access to the old databases?
If so, I would run the SQL Server 2008R2 Upgrade Advisor on those databases to see what are the issues if you migrate them. Once the issues are resolved (if it found some) then a simple backup and restore in the new server will solve your problem.

Do not forget to migrate the databases users as well. I don't think SA will be needed since is not a good practice to use that user for applications.
0
 
LVL 35

Expert Comment

by:David Todd
ID: 40313078
Hi,

Additionally to what Vitor said, if you need to migrate a large number of user accounts (logins) look up the appropriate sp_help_revlogin procedure and apply that.

Do check out the post restore on 2008 tasks - sp_updateusage(?), update stats and the like, check the database compatibility setting, the page recovery setting as well.

HTH
  David
0
 
LVL 16

Expert Comment

by:DcpKing
ID: 40313520
Get hold of the company blackbaud in Charleston, SC. Thay make The Raisers' Edge and may be able to help you here.

hth

Mike
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:supprteng
ID: 40350915
The KB article for moving DBs between machines is simple.  The problem I have is running the restore to the new server.

1) Original server is Windows 2003 with SQL 2005
2) New server is Windows 2012 with SQL 2008 R2.  

I backup the DB on the Original Server and copy the bak to the New Server. Using the Restore utility in SQL I get WITH MOVE errors.  See below:

Command:
RESTORE DATABASE [re7] FROM  DISK = N'E:\AD\Test.bak' WITH  FILE = 1,  MOVE N'DB_2' TO N'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7.mdf',  MOVE N're7_bio' TO N'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7.mdf',  MOVE N're7_gift' TO N'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7.mdf',  MOVE N're7_index' TO N'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7.mdf',  MOVE N're7_temp' TO N'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7.mdf',  MOVE N'DB_2_log' TO N'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7_1.ldf',  NOUNLOAD,  REPLACE,  STATS = 10
GO

Error Result:
Msg 3176, Level 16, State 1, Line 1
File 'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7.mdf' is claimed by 're7_bio'(3) and 'DB_2'(1). The WITH MOVE clause can be used to relocate one or more files.
Msg 3176, Level 16, State 1, Line 1
File 'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7.mdf' is claimed by 're7_gift'(4) and 'DB_2'(1). The WITH MOVE clause can be used to relocate one or more files.
Msg 3176, Level 16, State 1, Line 1
File 'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7.mdf' is claimed by 're7_index'(5) and 'DB_2'(1). The WITH MOVE clause can be used to relocate one or more files.
Msg 3176, Level 16, State 1, Line 1
File 'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7.mdf' is claimed by 're7_temp'(6) and 'DB_2'(1). The WITH MOVE clause can be used to relocate one or more files.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
0
 
LVL 35

Accepted Solution

by:
David Todd earned 500 total points
ID: 40351052
Hi,

Your restore command is meaningless. Let me write the first bit in plain English. Restore database called re7 from this disk file, move the logical file db_2 to the physical file re7.mdf, move the logical file re7_bio and trash the physical file of re7.mdf, etc.

The mistake is that you have re-used the re7.mdf physical file in the one command.

Try this:
RESTORE DATABASE [re7] 
FROM  DISK = N'E:\AD\Test.bak' 
WITH  
    FILE = 1
	, replace 
	, MOVE N'DB_2' TO N'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7_data.mdf'
	, MOVE N're7_bio' TO N'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7_bio.ndf'
	, MOVE N're7_gift' TO N'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7_gift.ndf'
	, MOVE N're7_index' TO N'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7_index.ndf'
	, MOVE N're7_temp' TO N'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7_temp.ndf'
	, MOVE N'DB_2_log' TO N'E:\SQLDatabases\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\re7_log.ldf'
	, STATS = 10
 GO

Open in new window


Note that the secondary data files have ndf as a file extension, that each physical file is unique, that each clause is on its own line.

HTH
  David

PS Test first before applying to production, etc.
0
 
LVL 3

Expert Comment

by:smilieface
ID: 40439122
And to recover the SA account password requires a brief outage.

http://technet.microsoft.com/en-us/magazine/jj853293.aspx
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

762 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

18 Experts available now in Live!

Get 1:1 Help Now