Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I currently have a Windows 2003 server installed with SQL Server 2000 and 2005 on it.

We have the disk partitioned in two:

  • C: contains the operating system and applications
  • E: contains the DB files

I need to reinstall the server due to license changes, and reinstall the databases as well. Is it possible to do this:

  1. Reinstall Windows on C:
  2. Reinstall SQL Server 2000 and 2005 (ok, maybe only 2005)
  3. Reattach all the DBs and have the server work as if nothing had happened to it.
share|improve this question

2 Answers 2

up vote 6 down vote accepted

From a 10,000 foot view, yes this is possible.

From a 1 foot view you'll need to account for things like: the server name, the server ip address, SQL logins, local user accounts, backing up and restoring the databases, etc., etc.

share|improve this answer
    
Agreed. This is the process I often take (from a 1 foot view, that is). –  squillman Mar 17 '11 at 18:21
    
Why do I need to backup and restore the databases? If I keep the data folder the same, can't I just reattach them? –  pgb Mar 17 '11 at 18:28
2  
You can, but the point is that you should back them up prior to attempting to rebuild the server. Even if you're only reinstalling the OS I'd hate to see you lose the databases because they weren't backed up. –  joeqwerty Mar 17 '11 at 19:36
    
Yes, definitely back the databases up like @joeqwerty says. If for any reason you experience corruption with the data files then you're pretty much done for. –  squillman Mar 17 '11 at 19:55
    
Agreed. What about the master DB? Should I try reattaching it (or restoring it), or leave the new one and rebuild users as needed? –  pgb Mar 17 '11 at 21:32

Ensure you backup all the databases (including the system databases except TempDB).

Then once Windows and both SQL Server's are install you restore the databases. By restoring master you will also restore server level objects (like logins).

When you restore a database you can specify different locations for the files (if you need to).

MSDN (and probably technet: SQL Server Books online seem to be on both) include lots of details.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.