1

I have installed MSSQL server 2008 in my server in C: drive and I want to move it to the D: drive completely. That means, database locations, installed location to move another drive with data. Is it possible to done this?

Note: Detach method is only for move database. but I want to move whole installation and DB files to another drive.

migrated from stackoverflow.com Jul 11 '16 at 12:17

This question came from our site for professional and enthusiast programmers.

  • 3
    If you want to move the actual server install you have to uninstall and then reinstall. This is no different than any other windows application. You can't just move the installed files somewhere new. – Sean Lange Jul 7 '16 at 14:41
  • 2
    Offtopic. Not a programming question. Maybe try the DBA site. – Marc B Jul 7 '16 at 14:41
  • @SeanLange If my source control is connected with SQL and the data is there. So, If i reinstall then need to add these data again manually or is it possible to take backup completely? – KaviSuja Jul 11 '16 at 12:02
2

It is easy and well documented to move data files (including master, model, tempdb,...) to other locations in MS-SQL Server. There is no supported approach to move the instalation (SQL Server binaries) to another drive / folder. I think even with manual manipulation of registry entries the SQL Server wouldn't come up again.

You should consider uninstall and new installation.

  1. backup all databases including system databases as master, model ( SSISDB)
  2. uninstall SQL Server using SQL Server installation center
  3. uninstall SQL Server 2008 Browser component by using the Add or Remove Programs
  4. install SQL Server with same instance name using SQL Server installation center; select new locations for binaries and data
  5. restore backups

This article describes how to uninstall a stand-alone instance of Microsoft SQL Server 2008. When you follow the steps in this article, you also prepare the system so that you can reinstall SQL Server 2008

  • There is no point in restoring tempdb. It is recreated each time the instance restarts. SQL Server uninstall is not "clean." The OS may get confused if the new instance has the same name as the old, but is in a different location. I would suggest you install the new one first as a named instance, migrate application DBs, jobs etc one at a time, reconfiguring applications to point to the new instance. Once everything's moved uninstall the old instace. – Michael Green Jul 12 '16 at 3:06
  • @MichaelGreen totally agree with tempdb. but when i install a named Instance, it will share common files with default instance... right? – Joe Platano Jul 12 '16 at 3:18
  • Yes, some files are shared between instances. Some files on the C: drive may be retained even after you uninstall the current instance. However, experience suggests some files and registry keys will remain even if the current instance is "removed" before the new instance is installed. – Michael Green Jul 12 '16 at 3:23
  • Of course if this is a personal / sandbox instance it's less important so just do what's easy and get on with life. – Michael Green Jul 12 '16 at 3:23
  • @MichaelGreen MS has here a guideline how to uninstall and ensure a reinstallation of sqlserver2008. Following this guide even the common files folder can be changed during the installation of the new default instance. Do you think MS will give this guide for non production only? – Joe Platano Jul 12 '16 at 4:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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