?
Solved

migrating sql databases to new server

Posted on 2014-09-08
6
Medium Priority
?
128 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 51

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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
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.

764 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