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
Solved

How to move SQL Express server

Posted on 2007-03-22
17
682 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

856 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