all groups > sql server new users > january 2006 >
You're in the

sql server new users

group:

copying databases


copying databases Les Stockton
1/27/2006 1:09:27 PM
sql server new users:
I have a server with an existing set of databases. We have a new server that
we'll be migrating to and so what I'd like to do is get at least one database
copied over to the new machine so I can do some testing. The problem is, the
two machines have little or no network connectivity currently.
I tried doing a backup, burning the backup to dvd and then putting that on
the new machine and doing a restore, but I was trying to restore to the
original location of the database, which was on a drive that doesn't exist on
the new server.
So how can I accomplish what I need to?
Re: copying databases Les Stockton
1/27/2006 1:31:27 PM
WIll this work with SQLServer 2000?

[quoted text, click to view]
Re: copying databases Les Stockton
1/27/2006 1:34:27 PM
Is there a way to do a search in BOL. I cannot find with "With Move" option
you mentioned.


[quoted text, click to view]
Re: copying databases Les Stockton
1/27/2006 1:37:27 PM
I was hoping not to interrupt operation on the existing server, but I might
ahve to if I can't do it any other way.

As for your suggestion of restoring to new location, I'd like to do that,
but find no way to do so. I'm running on SQLServer 2000 (don't ask me why,
but that's the way it is and I don't have any say in the matter). Is this
option available in 2000? and if so, where because I can't find it.

[quoted text, click to view]
RE: copying databases Les Stockton
1/27/2006 2:09:27 PM
I give up. BOL was a waste of time. You have to know how to do it, in order
to find the section that tells how to do it.
Never mind.

[quoted text, click to view]
RE: copying databases Les Stockton
1/27/2006 3:19:26 PM
Okay. Trying again.
I'm using Enterprise Manager with SQL Server 2000.
I pull up a table using the Query option so that I can enter the following:

RESTORE DATABASE ABC
FROM DISK='C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\abc.bak'
WITH MOVE 'ABC_Data' TO 'C:\Program Files\Microsoft SQL
Server\MSSQL\Data\ABC_Data.mdf'

No matter what variation I try, it says that it can't parse this command.
It's practically the same (except for name changes) as examples in the BOL.
Any idea?



[quoted text, click to view]
Re: copying databases Les Stockton
1/27/2006 3:23:27 PM
This is the web version? The index? Restore (Described)? Can't find it.

[quoted text, click to view]
Re: copying databases Raymond D'Anjou
1/27/2006 4:26:52 PM
[quoted text, click to view]

You just need to specify the new location for the files when you do the
restore.
Use the same location that SQL server stores the files by default on the new
server.
You have an option "move" when you use Restore Database".
You can also do this in EM.
You could also copy the physical files to the new server and "attach" them.
I believe that you have to "detach" them first on the old server,
effectively shuting it down.

Re: copying databases Hugo Kornelis
1/27/2006 10:23:18 PM
[quoted text, click to view]

Hi Les,

Since you already have the backup on DVD, I suggest using restore with
the WITH MOVE option. Check out Books Online for the details.

An alternative way would have been to detach the databases on the
original servers, copy the database files, then attach the original DB
files to the original server and the copies to the new server.

--
Re: copying databases Hugo Kornelis
1/28/2006 12:11:54 AM
[quoted text, click to view]

Hi Les,

Yes, it will.


[quoted text, click to view]

In the index, go to "RESTORE (described)". Then scroll down until you
get to the description of the MOVE argument.

Or, go to "Copying database, overview". Some excellent examples there.
Plus a description of how to do this very easily with Enterprisse
Manager.

--
Re: copying databases Hugo Kornelis
1/28/2006 12:35:23 AM
[quoted text, click to view]

Hi Les,

Try it in Query Analyzer. If you then still get errors, copy and paste
the error message for us to look at.

Or use the complete guided dialog from Enterprise Manager: rightclick
the Databases icon, select All tasks / Restore Database; Enter name of
DB to restore and location of backup on the first tab, then go to the
options tab and enter or change the locations mentioned in the "Restore
As" column.

--
Re: copying databases Hugo Kornelis
1/28/2006 12:38:21 AM
[quoted text, click to view]

Hi Les,

I used the version installed on my hard disk. Here's a link to the
RESTORE command in the web version:

http://msdn.microsoft.com/library/en-us/tsqlref/ts_ra-rz_25rm.asp

--
Re: copying databases Les Stockton
1/28/2006 6:19:26 AM
I tried your enterprise manager suggestion, but it refused to accept it.
Haven't tried the first idea yet.

[quoted text, click to view]
Re: copying databases Hugo Kornelis
1/28/2006 11:33:04 PM
[quoted text, click to view]

Hi Les,

Did you get an error message? If so, what was it? If not, then what does
"refused to accept" mean?

[quoted text, click to view]

You might have more luck with that, if the EM route doesn't work for
you.

--
AddThis Social Bookmark Button