all groups > sql server (microsoft) > december 2006 >
You're in the

sql server (microsoft)

group:

Trouble moving db to another sql2005


Trouble moving db to another sql2005 dgk
12/21/2006 10:44:34 AM
sql server (microsoft): I'm trying to copy a database from my machine's SQLServer2005 to a
production machine. I tried a restore from backup, which gave me an
error that the on disk structure was 611 and the production machine
supports 539. I've looked around and found similar problems, but those
were all involving SQL2000. These are both 2005. Oddly, the management
console of the production machine is version 9.00.2047.00, indicating
it's later than my machine's 9.00.1399.00. But that is the console,
not the db version, which I can't find.

My admin says that there is a big patch (or service pack) that
surprisingly isn't on the production machine and he'll do that
tonight. Does anyone know if that will cure the problem?

I don't even know if a restore will actually accomplish my goal of
getting the db into production. As you can tell, I'm not SQL2005
expert.

The db in question is the one that handles the authentication and user
profiles for asp.net version 2 (aspnetdb.mdf). I wrote the app using
sqlexpress am an now moving it to sqlserver. It works fine on my
machine and a test server, but apparently the production server is a
bit behind the times.

Any advice appreciated. I tried the script wizard but have no idea how
Re: Trouble moving db to another sql2005 RobinS
12/22/2006 12:35:18 PM
Well, the easiest way I have found to do this is to detach it
from one SQLServer (right-click on the database in the Management
Studio and choose Detach), copy the mdf and ldf files to to wherever
you want them, and attach the database (right-click on Databases
in the Management Studio and select Attach) in the new SQLServer.

I think this will work for you.
Good luck.
Robin S.
----------------------------------
[quoted text, click to view]

Re: Trouble moving db to another sql2005 dgk
12/26/2006 12:00:00 AM
On Fri, 22 Dec 2006 12:35:18 -0800, "RobinS" <RobinS@NoSpam.yah.none>
[quoted text, click to view]


No, got this error:
Could not find row in sysindexes for database ID 14, object ID 1,
index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database 'aspnetdb'. CREATE DATABASE is aborted.
(Microsoft SQL Server, Error: 602)

I'm guessing that the version of SQL2005 on the server is not the same
as the one on my machine. I'm having the admin check and update it.
Documentation on that error indicates that it could be one of 6,721
Re: Trouble moving db to another sql2005 RobinS
12/26/2006 9:24:29 PM

[quoted text, click to view]

I did this with several databases that I created with SQLServer2000
and it worked flawlessly (much to my surprise).

I don't understand why it's doing a Create Database. Is it doing that
when you detach it, or when yoy attach it? Because you should just
attach it to the new instance, not create it or do anything like
that. Did it detach successfully? Did you copy both the mdf and the
ldf files over to the new location?

Robin S.

Re: Trouble moving db to another sql2005 RobinS
12/26/2006 11:58:24 PM

[quoted text, click to view]

I've done it there, too. If the files are from SQLServer Express,
I don't think you even even have to detach them, you can just
copy them wherever. So you get errors when you try to attach
them on your SQLServer2005? You're just trying to attach the
files, right, not create a database or anything like that?
What are the errors?

Robin S.

Re: Trouble moving db to another sql2005 Jonathan Roberts
12/27/2006 12:11:21 AM
[quoted text, click to view]

I agree w/ you. I did this on 2000 many times and more recently on
2005. The 2005 scenario was going from Express Edition to Developer
AddThis Social Bookmark Button