HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMinor

How to change entire SQL server location from C:\ program file to another drive?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
fileentiresqlprogramanotherhowserverfromchangedrive

Problem

scenario:

one of my client was asked me to move entire program files folder from C:\ drive E:\ drive and change the all databases location to E:\ drive. They have copied entire program file folder through third party tool and pasted it on E:\ drive and they asked me to change path of databases and SQL installation to E:\ drive. Now how to change all databases paths and how to do this kind of activity? i know how to move system and user databases manually from one drive to another but i haven't face this king of scenario. Please suggest me how to do this task without any errors.

Solution

Trying to move a SQL Server installation in this manner is very dangerous, time consuming, and unsupported. If someone did this to my server I would not sleep well.

A better approach would be to:

  • Take note of exactly what service pack and CU level is running, and any non-default configuration items in SQL Server Configuration Manager



  • Backup all system and user databases



  • If you need to move user database files, detach the user databases and move the files



  • Uninstall SQL Server



  • Install SQL Server with the new drive configuration



  • Install service packs and/or cumulative updates to get to the version noted in step 1



  • Restore the master and msdb databases



  • Apply non-default configurations in SQL Server Configuration Manager



  • If the user database files have been moved, attach them



Please note that these are general steps and don't account for things specific to your environment, such as shutting down application servers, etc.

Context

StackExchange Database Administrators Q#225484, answer score: 5

Revisions (0)

No revisions yet.