Resolving the TIA Portal V16 WinCC SQL Server Instance Conflict
The error "Please remove the WinCC instance of SQL Server" blocks the TIA Portal V16 (or V15.1) installation or update on a workstation that already hosts TIA Portal V17 or V18 with WinCC Professional or WinCC Unified. The message is generated by the TIA Setup because the bundled Microsoft SQL Server instance expected by the V16 WinCC component collides with a newer SQL Server instance already present on the machine. The fix is not simply "uninstall any SQL Server" — the operator must identify which named SQL instance belongs to the V16 (or older) WinCC component, remove only that instance, and then clean up the orphaned database files before the V16 setup can complete.
This guide consolidates the official Siemens removal workflow with the engineering judgment needed to preserve a working V17/V18 environment.
1. Problem Description
During the install, repair, or update of TIA Portal V16 (or V15.1), the Siemens Setup displays one of the following error dialogs:
- "Please remove the WinCC instance of the SQL Server because it still exists in an incompatible version for TIA Portal STEP 7 & WinCC Professional V15.1 / V16."
- "A SQL Server instance required by WinCC is missing or in an incompatible version."
- "Setup has detected that a previous version of a SQL Server instance used by WinCC Professional is still installed."
The dialog appears immediately after the Setup prerequisites check, before any V16 project components are written to disk. Exit code 0x80004005 is typically written to %TEMP%\Siemens\SetupLogs.
The root cause is a hardcoded dependency between every WinCC Professional / WinCC Runtime Professional / WinCC Unified version and a specific named SQL Server instance with a specific SQL Server build number. When two TIA Portal major versions are installed on the same machine, only one of them can own the SQL instance; the older version's instance is left as an orphan and the newer V16 setup refuses to install over it.
2. Root Cause Analysis
WinCC Professional, WinCC Runtime Professional, and WinCC Unified ship their own private Microsoft SQL Server instance. Each TIA Portal major release pins a specific SQL Server build:
| TIA Portal Version | SQL Server Version Shipped | Default Instance Name | Notes |
|---|---|---|---|
| V15 / V15.1 | SQL Server 2014 SP2 (12.0.5000) | WINCC |
Legacy, often remaining after uninstall |
| V16 | SQL Server 2016 SP2 (13.0.5026) | WINCC |
Re-uses the legacy instance name |
| V17 | SQL Server 2019 (15.0.2000) | WINCC |
Same instance name, newer binaries |
| V18 | SQL Server 2019 (15.0.4000) | WINCC |
In-place upgrade path from V17 |
| V19 | SQL Server 2022 (16.0.1000) | WINCC |
Latest, co-exists with V18 only on dedicated machines |
Because all WinCC versions use the same logical instance name WINCC, the Windows Installer for V16 sees a SQL instance at the expected path but with binaries that are too new (V17/V18) or too old (a V15.1 leftover). The Setup's prerequisite check fails with the conflict message because the bundled V16 WinCC setup cannot start the existing WINCC instance to validate the schema version of CC_PM_Starter, CC_PM_Connectivity, and the alarm logging tables.
The official Siemens position is documented in the TIA Portal Updates Readme under Removing an SQL instance (see references in the procedure below): the V16 (or older) WinCC product must be uninstalled through Control Panel, and any orphan SQL instance that survives the WinCC uninstall must be removed separately through Programs and Features.
3. Affected Versions and Compatibility Matrix
The following TIA Portal versions are known to produce the error:
| TIA Portal Version | Build / Update | Error Reproducible | Workaround |
|---|---|---|---|
| V15.1 | Update 1 – Update 9 | Yes | Manual SQL removal |
| V15.1 | Update 9 with WinCC Unified Comfort | Yes | Manual SQL removal |
| V16 | Update 0 – Update 7 | Yes | Manual SQL removal |
| V16 | Update 5+ with WinCC Unified V16 | Yes | Manual SQL removal |
| V17 | Update 0 – Update 9 | Only on dual-version downgrade | Run V16 Setup first in clean mode |
| V18 | Update 0 – Update 4 | Only on dual-version downgrade | Run V16 Setup first in clean mode |
4. Pre-Uninstall Inventory: Identify Which SQL Instance Belongs to V16
Before touching anything, capture a complete picture of the SQL landscape on the workstation. Open Command Prompt (Admin) and run:
sc query | findstr /i "MSSQL"
sc qc "MSSQL$WINCC" | findstr BINARY_PATH_NAME
sc qc "MSSQL$WINCC" | findstr SERVICE_START_NAME
Then enumerate the installed SQL Server instances with their build numbers:
reg query "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server" /s | findstr "CurrentVersion"
reg query "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" /s
Cross-reference the build numbers with the table in Section 2. A V16 WinCC installation will report SQL Server 2016 SP2 (13.0.5026.x). If the build number reads 15.0.x, the WINCC instance belongs to V17/V18 and must be preserved.
Confirm the owning TIA Portal version through the Windows registry:
reg query "HKLM\SOFTWARE\Siemens\Automation\InstalledSoftware\TIA" /s | findstr "Version"
Take a screenshot of the following for the change log:
-
appwiz.cpl→ list of installed programs (full screen capture). - SQL Server Configuration Manager → SQL Server Services (instance state, start type, log-on account).
- Path of
C:\Program Files\Microsoft SQL Server\showing all installed instance folders.
5. SQL Server Instance Architecture Inside TIA Portal
Every WinCC Professional / Unified installation drops a per-instance folder under %ProgramFiles%\Microsoft SQL Server\:
C:\Program Files\Microsoft SQL Server\
├─ MSSQL13.WINCC (V15.1 / V16 — SQL 2016)
├─ MSSQL15.WINCC (V17 / V18 — SQL 2019)
└─ MSSQL16.WINCC (V19 — SQL 2022)
The instance name WINCC is hard-coded in the WinCC services:
WinCC Server (instance=WINCC)
WinCC Archive Server
WinCC Connectivity Server
CCAgent
CCEServer
CcAlgRtServer
CcMsgRtServer
When V16 Setup detects that the path MSSQL13.WINCC\MSSQL\DATA\master.mdf is missing or that the existing MSSQL15.WINCC master database has a newer schema version than V16 expects, the prerequisite check fails and the user sees the remove-the-instance prompt. The newer instance cannot simply be downgraded, so the operator must remove the old instance (or the orphan), then let V16 recreate its own.
6. Step-by-Step Removal Procedure
Follow this exact sequence. Do not skip steps.
6.1 Stop all WinCC and SQL Services
net stop "SQL Server (WINCC)"
net stop "SQL Server Agent (WINCC)"
net stop "CCAgent"
net stop "CCEServer"
net stop "WinCC Server"
taskkill /F /IM sqlservr.exe
taskkill /F /IM sqlwriter.exe
6.2 Uninstall the V16 (or older) WinCC product via Control Panel
- Press Win + R, type
appwiz.cpl, press Enter. - Sort by Publisher, locate Siemens AG.
- Select the V16 entry: SIMATIC STEP 7 / WinCC Professional V16.0 (or V15.1).
- Click Uninstall / Change and choose Uninstall.
- Wait for the WinCC uninstall to complete; the SQL instance created by V16 is supposed to be removed automatically.
6.3 Remove the orphan SQL Server instance
If the V16 WinCC uninstall reports success but the WINCC instance is still present (the most common cause of the recurring error), remove the SQL Server entry manually. This is the official Siemens workflow documented in the TIA Portal V20 readme at Removing an SQL instance - TIA Portal V20 Updates and in Removing an SQL instance - TIA Portal V20 Installation:
- Open the Control Panel.
- Click Uninstall a program (or Programs and Features).
- From the list of installed programs, locate the Microsoft SQL Server entry that matches the V16 build (SQL Server 2016, version 13.0.x). The entry typically reads Microsoft SQL Server 2016 (64-bit) with a sub-entry for the
WINCCinstance. - Click Uninstall/Change. The SQL Server Installation Center launches.
- Select Removal → choose the
WINCCinstance → click Next. - Select SQL Server Database Engine Services, SQL Server Replication, and Client Tools Connectivity for the
WINCCinstance. - Click Next → Remove. The instance binaries are uninstalled; the
MSSQL13.WINCCfolder is removed automatically. - Repeat for the corresponding Microsoft SQL Server 2016 Setup (English) support files if they remain.
6.4 Remove orphan databases and registry keys
Some legacy databases (V15.1 era) survive the SQL uninstall. Clean them up:
del /S /Q "C:\Program Files\Microsoft SQL Server\MSSQL13.WINCC\MSSQL\DATA\*.mdf"
del /S /Q "C:\Program Files\Microsoft SQL Server\MSSQL13.WINCC\MSSQL\DATA\*.ldf"
rmdir /S /Q "C:\Program Files\Microsoft SQL Server\MSSQL13.WINCC"
Remove the registry keys for the dead instance (only if no other product references them):
reg delete "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.WINCC" /f
reg delete "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL\WINCC" /f
reg delete "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server\MSSQL13.WINCC" /f
6.5 Clear the WinCC-specific folders
Delete leftover project and archive folders from V15.1/V16 WinCC installations:
rmdir /S /Q "C:\ProgramData\Siemens\Automation\WinCCProjectManagerV16"
rmdir /S /Q "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Siemens Automation\TIA Portal V16"
rmdir /S /Q "C:\Users\<USER>\AppData\Local\Siemens\TIA Portal V16"
6.6 Reboot
Reboot the workstation. This releases any handle on master.mdf, the registry hive HKLM\SOFTWARE\Microsoft\Microsoft SQL Server, and the WinCC services that survived the previous step.
7. Preserving TIA Portal V17 and V18
The V17/V18 environment uses the MSSQL15.WINCC folder and the SQL Server 2019 binary tree. The removal steps above only touch the MSSQL13.WINCC path, the registry keys under MSSQL13.WINCC, and the V16-specific program entries. To verify that V17/V18 are intact after the cleanup:
- Open TIA Portal V17 → create a new WinCC Professional project → add a screen with one I/O field → close.
- Open TIA Portal V18 → compile the same project → verify zero errors.
- Run
sc query "MSSQL$WINCC"→ status must readRUNNING. - Run
sqlcmd -S .\WINCC -E -Q "SELECT @@VERSION"→ must returnMicrosoft SQL Server 2019 (RTM) ....
If the V17/V18 environment no longer starts, the wrong instance was removed. Restore the registry hive from the pre-uninstall export and reinstall the matching SQL Server 2019 instance from the V17 setup media.
8. Reinstall TIA Portal V16
With the SQL landscape clean, launch the V16 Setup:
- Mount the V16 installation media (DVD ISO or download package).
- Right-click
Start.exe→ Run as administrator. - Accept the license agreement and choose the destination language.
- In the product selection, enable WinCC Professional only if the operator actually needs V16 WinCC; otherwise pick STEP 7 Professional alone to avoid re-pulling the SQL instance.
- Click Install. Setup detects the existing
WINCCinstance (now SQL 2019 from V17/V18) and registers the V16 WinCC components against the newer instance where the schema permits — or installs a freshMSSQL13.WINCCif the operator uninstalled the newer one.
Exit codes: 0 = success, 3010 = success with reboot required, anything else = review %TEMP%\Siemens\SetupLogs\Siemens.Setup.Log.
9. Verification Checklist
| Check | Command / Action | Pass Criteria |
|---|---|---|
| SQL instance present | sc query "MSSQL$WINCC" |
State = RUNNING |
| SQL build matches TIA version | sqlcmd -S .\WINCC -E -Q "SELECT @@VERSION" |
13.0.5026 (V16) or 15.0.x (V17/V18) |
| WinCC services start | net start CCAgent && net start CCEServer |
Both return success |
| TIA Portal V16 launches | Start menu → TIA Portal V16 | Portal opens, no SQL banner |
| V17 still functional | Open V17 sample project | Compile OK |
| V18 still functional | Open V18 sample project | Compile OK |
| Alarm logging schema | WinCC Explorer → Tag Management → connect | No schema version error |
10. Troubleshooting Matrix
| Symptom After Cleanup | Likely Cause | Remediation |
|---|---|---|
| Setup still says "remove the WinCC instance" | Orphan WINCC instance still in registry |
Re-run step 6.4 with elevated prompt |
| V17 WinCC will not start | Wrong instance removed | Reinstall V17 with WinCC Professional to recreate the SQL 2019 instance |
| Setup returns 0x80004005 | SQL Server WINCC service set to Disabled |
Re-enable via sc config "MSSQL$WINCC" start= auto
|
| Schema version error on V17 project | V16 setup downgraded the database | Restore CC_PM_Starter and master.mdf from backup |
| "The setup has detected an incompatible version of the .NET Framework" | OS image missing KB updates | Install .NET Framework 4.7.2 + KB 4580977 |
| WINCC instance runs but WinCC RT refuses to start | Service account lost Log on as service right | Re-grant via secpol.msc → Local Policies → User Rights Assignment |
11. Field-Proven Caveats
-
Do not run the V16 setup twice in a row. The first run writes partial registry entries under
HKLM\SOFTWARE\Siemens\Automation\InstalledSoftware\TIA\V16; the second run collides with them and re-emits the same SQL error. -
Domain service accounts: If the SQL Server
WINCCservice is running as a domain user, deleting the instance without resetting the SPN can leave stale Kerberos tickets. Re-register the SPN withsetspn -R <HOSTNAME>. -
Antivirus interference: Some endpoint protection suites (CrowdStrike, SentinelOne) flag
sqlservr.exeduring uninstall. Pre-stage the SQL removal in an AV exclusion window. - Multi-user workstations: Always notify other engineers on the same machine before uninstalling a SQL instance. A second TIA Portal user will lose the live connection to WinCC Runtime.
- VM-based engineering pools: If the engineering station is a Citrix published app or a Windows Server RDS session, the V16 SQL instance is shared across all users. Uninstallation affects the entire pool.
Which SQL instance is safe to remove on a V16/V17/V18 workstation?
Remove only the WINCC instance whose build number matches the TIA version you are uninstalling. V16 uses Microsoft SQL Server 2016 SP2 (13.0.5026.x). V17 and V18 use Microsoft SQL Server 2019 (15.0.x). The official Siemens procedure is documented under Removing an SQL instance - TIA Portal V20 Installation.
Can TIA Portal V16, V17, and V18 coexist on one PC?
Siemens officially supports only the current version and the previous major version (N and N+1) on a single engineering workstation. V16/V17/V18 tri-installation is not supported and is the underlying reason the SQL instance conflict appears. Use dedicated physical machines or one VM per major version for migration projects.
Do I need to delete the SQL database files manually after uninstalling WinCC?
Yes. WinCC uninstall removes the V16 MSSQL13.WINCC folder only when the uninstall completes cleanly. If the uninstall is interrupted, files under C:\Program Files\Microsoft SQL Server\MSSQL13.WINCC\MSSQL\DATA and the registry hive HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.WINCC remain and trigger the V16 setup error on the next attempt.
How do I verify that V17 and V18 still work after the V16 SQL cleanup?
Open an existing V17 or V18 project, run Compile > Software (rebuild all), and confirm zero errors. Also run sqlcmd -S .\WINCC -E -Q "SELECT @@VERSION" — the response must report SQL Server 2019 (15.x), which is the V17/V18 instance.
What if removing the wrong SQL instance breaks the V17/V18 environment?
Reinstall the matching V17 (or V18) WinCC Professional component. The Siemens setup will recreate the WINCC instance with the correct SQL 2019 binaries and re-register the WinCC services against MSSQL15.WINCC. A registry export taken before the cleanup is the fastest way to recover service-account and SPN bindings.