My current project involves lot of migration of servers from one data room to a new datacenter or local data room at new location for the customer. This involves installation of many SQL Servers. There exist many SQL Server 2000 database servers and we decided to install SQL Server 2008 R2 and run the SQL Server 2000 databases with the Compability Level option. Microsoft only support the latest 3 version with this option. This means that SQL Server 2008 R2 is the latest version we can use for support of SQL Server 2000. Windows Server 2008 R2 is used and Powershell 2.0.
You start by generating your installation options by running a standard install with all the options you want for your SQL Server. When you reach the “Ready To Install” a file called ConfigurationFile.ini with a path is generated with all your options set. Normally, you click install at this point, but just copy the filepath and press “Cancel”. This is shown in the screenshot below.
The next step is to modify the ConfigurationFile.ini to be able to run the installation without any interaction. Put the following statements below the “ACTION=Install” statement:
IACCEPTSQLSERVERLICENSETERMS="True" INDICATEPROGRESS="True" QUIETSIMPLE="True"
You have to remove the UIMODE statement since this is not combinable with the QUIETSIMPLE statement. This should be enough to perform a unattended installation from the command-line:
In my case, the DVD has the drive letter D: and my installation scripts are located in C:\Install folder.
The next step is to create a powershell script with pre- and post-installation tasks (OS and DB) that you need to perform during the before and after installation. Jonathan Kehayias at sqlskills.com has a very good checklist post that can be used to complete your powershell script. In my current script I’m checking the ‘Allocation Unit Size‘ for the data, log and tempdb disks, in addition to configuring the ‘Maximum Server Memory‘ and initial user rights.