QUESTION
How to move SQL data files to a new partition or Disk drive on the same SQL server.
The drive that SQL was initially installed on may be running out of space. Or you may wish to move the data files to another drive to improve SQL performance.
ANSWER
Microsoft recommends that the SQL executable files be on a different disk drive than the data files for performance reasons. In addition, you may want to move the data files to a new drive which has more space.
Note that moving the data files is much simpler and faster than moving all of SQL, which would require a re-install of SQL and several additional steps.
To move the data files, follow this procedure:
- Backup the SQL database. We don't actually require this, but it only takes a few minutes and then we have a backup "just in case". You can backup the database from the Kaseya System > Configure page. Click "Backup now". The backup location MUST be on a drive on the SQL server.
- Stop the Kaseya Services
- Open the SQL Management Console and expand the "Databases" tree. Highlight the ksubscribers database, right click and select properties. There is a tab that I believe is named "Files". On that dialog you will find the path to the Ksubscribers data files. There are two files, one with an extension of MDF and another with an LDF extension. Make a note of the location.
- In SQL Management Console, highlight "Ksubscribers". Right click and in the "Tasks" menu select "Detach".
- Now move those data files to the new location. (We suggest you move them, not just copy them.)
- In the SQL Management Console, highlight "Databases". The Ksubscribers will not be there because it has been detached. Right click in "Databases" and select "Tasks" > "Attach". You will be asked where the data files are, point SQL to the new location.
- Restart the Kaseya Services.
MORE INFORMATION
In addition to moving the data files, you could also make sure the backup location on the System > Configure page in Kaseya points to a drive other than drive C.
APPLIES TO
Kaseya v6.3 (Also applies to other versions)