Sql-server – how change database engine configuration storage from drive C: to N:

sql server

after installation sql server i need change database location from C: to N:
enter image description here

Best Answer

There are some possible solutions:

  • Stop the service and move all data to the new drive and create a symbolic (mklink) link for the folder to the new location and start the service again.

  • Stop the service and move all data to the new drive. Remove the folder and add a folder for the drive instead (or in addition) of a drive letter and restart the service

  • Move the database files as described in the Microsoft manuals. In this case you can decide which files to move. The two other possibilities described above cover the whole location with all databases.

Don't forget to grant permissions to the sql server service on the target folder or drive, otherwise the service won't start properly.