Solved

How to move SQL Express server

Posted on 2007-03-22
17
686 Views
Last Modified: 2013-11-16
I'm running an SQL express server as the backend of my database but need to move it to a new server. I cannot find steps on the internet to do so. Any help would be much appeciated.
0
Comment
Question by:prlit
[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
  • 8
  • 5
  • 4
17 Comments
 
LVL 19

Expert Comment

by:aissim
ID: 18773161
I haven't personally had to do this with SQL Express....but my best guess would be to install SQL Express on the new machine and then replicate the DB from old to new.
0
 
LVL 1

Author Comment

by:prlit
ID: 18773496
Is there somewhere I can find steps to to do the replication?
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 18773838
0
Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

 
LVL 19

Expert Comment

by:aissim
ID: 18773858
As you probably know there's no SQL agent with express...so there's only two alternate options.

Here's an article that lists your various options, as well as links to 'How-To's' for each option: http://msdn2.microsoft.com/en-us/library/ms165686.aspx


0
 
LVL 1

Author Comment

by:prlit
ID: 18773925
If my origional server died and I had to pull it off a backup tape, how would I do so?
0
 
LVL 19

Expert Comment

by:aissim
ID: 18774042
You could put it on disk from tape, and then the following from the sql command window:

RESTORE DATABASE dbname
FROM DISK = c:\foldername\backupname.bak
GO
0
 
LVL 1

Author Comment

by:prlit
ID: 18774108
That easy?? I just want to copy the olf c:\program files\sql express\ to an external hard drive and then hook that drive to the new server. There's a very little data on the server. What files should I copy?
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 18774311
any mdf, ldf or ndf files. Assuming the new server has the same name and IP address. It is a matter of installing the SQL Express as the same name and all. Then shut down the SQL Services, replace the ?df files and restarting the services.
0
 
LVL 19

Expert Comment

by:aissim
ID: 18774392
You'll probably have to install SQL Express on the new server...then copy the .bak file over (or put it on your external drive), then use the Restore command. It won't work to just copy the program files folder over to the new server - it needs to actually be installed (for registry entries, etc.).
0
 
LVL 1

Author Comment

by:prlit
ID: 18774520
The server doesn't have the same/ip name. I did a search of the SQL server express directory and there were no .bak files. I just want to copy all of the "data files" to a external hard drive and move them to the new server. I know I can't copy the program. If I go through and copy the .mdf, .ndf, and .ldf files, what command would I use below?

These commands:
RESTORE DATABASE dbname
FROM DISK = c:\foldername\backupname.bak  "what would go here since there's no .bak"
GO

Thanks for all the help!!!
0
 
LVL 38

Accepted Solution

by:
Jim P. earned 500 total points
ID: 18774638
There should be a master.mdf. This is what holds the list of the rest of the databases. If you copy the other ?df files you can put them in the same direstory and then bring them in by executing an attach. The syntax would look something like:
sp_attach_db 'MyDBName', 'C:\MyPath\MyDBName.mdf', 'C:\MyPath\MyDBName.ldf'
0
 
LVL 1

Author Comment

by:prlit
ID: 18774788
MY command: sqlcmd sp_attach_db 'MyDBName', 'C:\Data\PRL.mdf', 'C:\Data\PRL_log.ldf'

Gives me: Sqlcmd: 'sqlcmd sp_attach_db' : Unkown Option. Enter -? for help
0
 
LVL 1

Author Comment

by:prlit
ID: 18774798
Or am I actually copying the master.mdf or the dbname.mdf
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 18774996
If you copy the master.mdf from the Oldserver and replace it the newserver, and have the same paths to on your newserver for all the other ?df files they will be there.

If you are using the the new master from the new install then you can attach the pre-existing ?df files using the sp_attach_db command. The syntax I have is for SQL2K/MSDE. It may have changed. And wouldn't it be:

sqlcmd sp_attach_db 'PRL', 'C:\Data\PRL.mdf', 'C:\Data\PRL_log.ldf'

Note that you will have orphaned user ids between the master database and the PRL DB.
0
 
LVL 1

Author Comment

by:prlit
ID: 18775781
Gives me: Sqlcmd: 'sqlcmd sp_attach_db' : Unkown Option. Enter -? for help

I used: sqlcmd sp_attach_db 'PRL', 'C:\Data\PRL.mdf', 'C:\Data\PRL_log.ldf' Everything in that line is right for my details. Is there a typo in the command?
0
 
LVL 1

Author Comment

by:prlit
ID: 18776241
I was able to attach the server using the GUI of SQL Express. Very easy, did not require any commands.
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 18778923
I'm used to MSDE which did not really have any native GUI. Glad it worked out for you.

Glad to be of assistance. May all your days get brighter and brighter.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

728 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