-
-
The other day i wanted to change the "Data Files" location for a 2005 database engine installation and a 2005 Analysis Services installation which you can specify under the advanced options during installation. I quickly found out that there appears to be no documented ways to do this other than uninstall SQL Server and install again specifying a new location for data files. It's also not as simple as moving your system databases as "Data files" covers things like server errors logs, sql agent logs, replication default directory etc. So, as the uninstall route was not one i was prepared to go down i sat down and worked out how to do it and below are the results.
Analysis Services
- At the root level, copy the existing data folders to the new location.
- Open the registry editor and navigate to HKLM\SYSTEM\CurrentControlSet\Services\MSSqlServerOLAPService and edit the imagepath value. You will see a switch –s and after that a path, change that path to the new path.
- Locate the configuration file msmdsrv.ini in the config directory and open it. Update all references to the old location with the new location.
If you have not copied any cube data then there is nothing more to do. If you have copied cube data and you know the cubes are using all default storage locations then you do not need to do anything else but if you are not using default locations then they must exist otherwise the cube will error when starting. To update the locations you must find all the relevant xml files and update the paths.
Database Engine
Notes
- Some of the paths will vary when instances are installed. For example the directory path part MSSQL.1 could be MSSQL.2 or MSSQL.3 depending on install order and number of instances.
- Some of the registry paths may contain an instance name if you have a named instance.
- When you finish you may need to enable the service broker in the msdb database again as i found this necessary on 1 of my installs. The SQL error log will reveal if this is necessary.