Sql-server – How to sysprep SQL Server Express

sql serversql-server-2012sysprep

We plan to deploy Hyper-V VHD with Windows Server 2008 R2 and SQL Server 2012 Express installed to multiple hosts. From my understanding, the correct way to do this is to install SQL Server in prepartion mode, sysprep Windows, then complete SQL Server installation when the VHD is deployed. I mostly followed the process in this blog post: http://sethusrinivasan.com/category/sysprep/

However, after the VHD is deployed, I'm unable to complete the SQL Server installation. It keeps saying "Upgrade matrix is incorrect". It seems that it's trying to upgrade itself to Enterprise edition (I was asked for product key during install, but I skipped it). Could anyone share their experience in deploying VHDs with SQL Server (we're fine with either SQL Server 2008 R2 or 2012)?

I think the source of my issue is because I can't select "Express Edition" when entering the product key at the completion stage, so the installation is trying to do an upgrade to Enterprise Edition. I have no idea why the drop down list is empty.enter image description here

Best Answer

Turned out it was caused by the SQL Server setup. After the "prepare" stage, a shortcut to the "complete" stage will be added to the Start Menu. However, for some reason the shortcut links to the SQL Server Enterprise setup. To complete a SQL Server Express prepared instance, the setup must be launched from the SQL Server Express install media, using the command prompt.

To start the prepare stage, use

setup /action=PrepareImage

To complete a prepared instance, use

setup /action=CompleteImage

Hope this helps someone in the future.