?
Solved

How to move SQL Express server

Posted on 2007-03-22
17
Medium Priority
?
689 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

801 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