Solved

Move MS SQL server from C: to D: drive

Posted on 1998-12-16
7
303 Views
Last Modified: 2010-03-19
I have MS SQL 6.5 installed on the C: drive of my server, which is running out of space,(200MB). I would like to reinstall it onto the D: drive (2GB) what is the best way of doing this, transfering the databases etc?
0
Comment
Question by:mursell
[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
7 Comments
 

Expert Comment

by:kt1230
ID: 1092289
I would suggest one methods:

(1)Keep you existing SQL system and data file intact; Build a
   new device file on D drive, and expand your database to this
   newly created device. ( No need to reinstall, might get
   some perfomance boot and less hassle).
 


0
 
LVL 4

Expert Comment

by:dwwang
ID: 1092290
If you want to free the disk space of C:, I have a solution, I have done this before:

1. Delete your original database and then the corresponding device from Enterprise Manager. NOTE: the DAT file is not deleted when you delete the database and the device :)

2. Create a new device in D: of exactly the SAME NAME AND SIZE as the original one, then create the database, (also of exactly the same name of the original one)

3. Shutdown SQL server, then copy the old DAT file from C: to D: to overwrite the newly created DAT file.

4. Restart SQL Server and you can see every thing is OK now!

Anyway, you take your own risk to do all this.

You can first do some tests before take out the real task, also be sure to backup all schema/data before doing the transfer, it's always better than sorrow :)
0
 
LVL 1

Expert Comment

by:ivanh
ID: 1092291
I had the same problem, but all I did was move my database devices to another drive.  Microsoft has some stored proc that assist in this, but I had problems in even finding those stored procs (I think it was called sp_movedevice, or something like that), anyway, I move my master.dat and all my other dats manually and it works just fine.

Steps I took:
1.  Shut down SQL Server.  
2.  COPY (don't move) all your dats to the new location.  Master as well, if you want
3.  Go into the registry \\HKEY_LOCAL_MACHINE\Microsoft\MSSQLServer\Parameters.  Change SQLArg0 to the new location of your master.dat
4.  Start SQL Server
5.  In the master database, do a select * from sysdevices.  You will see all your dats and their path.  Change these to the new location of your dats with an update statement.
6.  stop and restart SQL Server

Poke around and make sure none of your DB's are suspect.  If so, then you will need to make a change in sysdatabases (status column).  

Just for kicks, I also ran a dbcc checkdb just to make sure everything was still okay.

If you want to leave your master.dat where it is, then just do 1,2,5,6

I've been running fine for about 3 weeks now.

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:ivanh
ID: 1092292
when you feel confident, delete the old dats.
0
 
LVL 1

Expert Comment

by:ivanh
ID: 1092293
I would also suggest before updating sysdevices that you make a copy of the table by doing a select into.
0
 
LVL 3

Accepted Solution

by:
traygreen earned 100 total points
ID: 1092294
If you want the server engine on th new drive, go ahead and install it there

then/or
1) Create a device on the D Drive
2) Create a database on the new device (must be as large as the source database - not actual data)
3) (if you created new server)make sure both servers are registered in one of the servers
4) Right click on the database on your c drive and select the "transfer" option
5) Verify the Source and set the target database
6) Click "Start Transfer"

Then you can delete the database on C and remove the device etc.
0
 
LVL 3

Expert Comment

by:traygreen
ID: 1092295
Other option is just to create a new device on the new drive and then Alter the database to include space from the new drive.
0

Featured Post

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

739 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