---
title: "Step 9: Remove legacy v6 IIS applications and Windows services – v6 to v7 Migration"
description: "Step 9 of the Nodinite v6 to v7 migration: remove the legacy v6 IIS applications, application pools, and Windows services with the CLI remove-legacy command, then remove the old agent services."
---

# :fa-forward-step: Step 9: Remove legacy v6 IIS applications and Windows services

After [Step 8][Step08] has verified v7, remove the old :Nodinite: v6 installation: the v6 [Core Services][] [IIS][] applications and application pools, the v6 Logging and Monitoring Windows services, the old TLS web site, and the v6 agent Windows services. The v7 web sites stay untouched.

>[!WARNING]
>Don't run this step before Step 8. Remove v6 only after the agents package from [Step 7][Step07] is installed and v7 is verified.

## Prerequisites

* [ ] [Step 8 completed – v7 functionality verified][Step08]
* [ ] PowerShell 7 with administrator privileges
* [ ] The extracted agents bundle from Step 7

## Recommended: Remove Legacy with CLI

First, save the v6 agent folders for [Step 13][Step13]: `remove-legacy` deletes the services, and with them the record of where each agent was installed.

```powershell
Get-CimInstance Win32_Service -Filter "Name LIKE 'Nodinite%' AND Name <> 'NodiniteUpdateService'" |
   ForEach-Object { Split-Path -Parent ($_.PathName.Trim('"')) } |
   Sort-Object -Unique | Set-Content -Path "Nodinite-AgentFolders.txt"
```

Then, from the root of the extracted agents bundle, preview the removal, and run it:

```powershell
.\Nodinite.Installer.Cli.exe remove-legacy --config .\nodinite01\config.cli.json --dry-run
.\Nodinite.Installer.Cli.exe remove-legacy --config .\nodinite01\config.cli.json
```

The command reads the environment name and the Legacy :Nodinite: 6 environment path from the configuration ([Step 1][Step01 Basics]) and runs three phases: it removes the v6 IIS applications, their application pools, and virtual directories; it stops and deletes the old v6 Windows services, including the [Logging Service][], the [Monitoring Service][], and the v6 agent services; and, only when you add `--delete-files`, it deletes the v6 files.

![CLI remove-legacy output with three phases][2]  
*Example of `remove-legacy` removing the v6 [Web Client][], [Web API][], and [Log API][] applications and pools, the v6 Logging and Monitoring Windows services, and skipping file deletion because `--delete-files` was not specified.*  

>[!IMPORTANT]
>`remove-legacy` doesn't remove the v6 Install and Update Tool (`NodiniteUpdate`), a custom v6 TLS web site that you created yourself, or the [IBM DataPower][DataPower] and [Dynamics CRM][Dynamics] agents, which stay on the MSI-based installer and aren't managed by the CLI. Remove `NodiniteUpdate` with **Programs and Features** in Windows, and the TLS web site as described below.

## Manual Fallback: Remove via IIS Manager

Use this only when you can't run `remove-legacy`.

### 1. Remove Old v6 Web Applications

![Nodinite v6 web applications in IIS Manager][3]  
*Example of old :Nodinite: v6 web applications to remove in IIS Manager.*  

1. Open IIS Manager on the :Nodinite: application server and expand **Sites**.
2. Find the site hosting the v6 applications, usually Default Web Site.
3. Remove `/Nodinite/ENV/WebClient`, `/Nodinite/ENV/WebAPI`, `/Nodinite/ENV/LogAPI`, and `/NodiniteUpdate/UpdateClient`.

### 2. Remove Old Application Pools

![IIS application pools including v6-era pools][1]  
*Example of v6-era IIS application pools to remove after their web applications are deleted.*  

Remove the v6-era pools, for example `Nodinite - %ENVIRONMENTNAME% - Web API`, only when they have **0** applications. Never remove a pool that serves a v7 web site.

## Remove the Custom v6 TLS Website

In v6, a dedicated IIS web site often terminated TLS. In v7, the CLI binds the certificate to each Core Service web site ([Step 10: Configure TLS][Step10]).

>[!IMPORTANT]
>Before you remove the custom web site, note its host name and the certificate subject; you enter both in Step 10.

1. In IIS Manager, identify the custom v6 :Nodinite: TLS web site.
2. Remove any web applications under it, then remove the site.
3. Open **Bindings** on Default Web Site and other sites, and remove bindings that use the :Nodinite: host name or the old certificate.

## Manual Fallback: Remove Old Agent Windows Services

Use this only when you can't run `remove-legacy`, or when v6 agent services remain afterwards in `services.msc`.

### Generate Removal Script

The script lists the remaining `Nodinite*` Windows services, writes a removal script, and saves each service's folder to `Nodinite-AgentFolders.txt` for [Step 13][Step13].

```powershell
try {
   $services = Get-Service | Where-Object { $_.Name -like "Nodinite*" -and $_.Name -ne "NodiniteUpdateService" }
} catch {
   Write-Warning "Some services could not be queried. Continuing with available services."
   $services = @()
}

$outputScript = "Remove-Nodinite-Services.ps1"
Set-Content -Path $outputScript -Value "# Auto-generated script to stop and remove Nodinite Windows services`n"

foreach ($service in $services) {
   Add-Content -Path $outputScript -Value "Stop-Service -Name '$($service.Name)' -Force"
   Add-Content -Path $outputScript -Value "sc.exe delete '$($service.Name)'`n"
}

$folderPaths = foreach ($service in $services) {
   $wmiService = Get-CimInstance Win32_Service -Filter "Name='$($service.Name)'"
   if ($wmiService -and $wmiService.PathName) {
      Split-Path -Parent ($wmiService.PathName.Trim('"'))
   }
}

$folderPaths | Sort-Object -Unique | Set-Content -Path "Nodinite-AgentFolders.txt"
Write-Host "Generated: $outputScript and Nodinite-AgentFolders.txt"
```

### Review and Execute

1. Open `Remove-Nodinite-Services.ps1` and `Nodinite-AgentFolders.txt`, and remove the entries for:
   * environments you are not migrating
   * the [IBM DataPower][DataPower] and [Dynamics CRM][Dynamics] agents, which stay on the MSI-based installer
2. Open PowerShell 7 as administrator and run `./Remove-Nodinite-Services.ps1`.
3. Verify the removal in `services.msc`.

## Completion Checklist

* [ ] `remove-legacy` completed, or the v6 applications and pools removed manually
* [ ] `NodiniteUpdate` removed with Programs and Features
* [ ] Custom v6 TLS web site and old host name bindings removed; host name and certificate subject noted
* [ ] Old v6 agent Windows services removed by `remove-legacy`, or with the manual fallback (IBM DataPower and Dynamics CRM kept)
* [ ] `Nodinite-AgentFolders.txt` saved for [Step 13][Step13]

## Troubleshooting

### Step 10 Fails with Binding Conflict

TLS configuration fails because a host name is still bound in IIS. Check the bindings on all IIS sites and remove duplicate host name bindings before you retry Step 10.

### Cannot Remove an Application Pool

IIS reports that the pool still has applications. Remove the remaining applications first, then restart IIS Manager and retry.

## :fa-hand-point-right: Next Steps

* [:fa-forward-step: Step 10: Configure TLS][Step10]  

## :fa-link-horizontal: Related Topics

* [Updating from v6 to v7 – Migration Guide][Main]  
* [IIS URL Rewrite – Legacy v6 Redirect][IIS URL Rewrite]  
* [Core Services Overview][Core Services]  
* [IIS Windows Features][]  

[1]:{ndm}/Documentation%20Pictures/IM/IMUpdate/Settings/IISAppPools.png
[2]:{ndm}/Documentation%20Pictures/IM/Portal/Env/v6_v7/CLI_RemoveLegacyNodinitev6CoreServices_Success.png
[3]:{ndm}/Documentation%20Pictures/IM/IMUpdate/Troubleshooting/NodiniteV6_WebApplications.png

[Core Services]:{ndr}/Core%20Services/Overview.md
[DataPower]:{ndr}/Logging%20and%20Monitoring/IBM%20DataPower%20Gateway/Overview.md
[Dynamics]:{ndr}/Logging%20and%20Monitoring/Microsoft%20Dynamics%20365/Overview.md
[IIS]:{ndr}/Install%20and%20Update/Troubleshooting/IIS/Overview.md
[IIS URL Rewrite]:{ndr}/Install%20and%20Update/Troubleshooting/IIS/IIS%20URL%20Rewrite%20%E2%80%93%20Legacy%20v6%20Redirect.md
[IIS Windows Features]:{ndr}/Install%20and%20Update/Troubleshooting/IIS/IIS%20Windows%20Features.md
[Log API]:{ndr}/Core%20Services/Log%20API/Overview.md
[Logging Service]:{ndr}/Core%20Services/Logging%20Service/Overview.md
[Main]:{ndr}/Install%20and%20Update/Getting%20started/Version%206/Updating%20from%20v6%20to%20v7.md
[Monitoring Service]:{ndr}/Core%20Services/Monitoring%20Service/Overview.md
[Step01 Basics]:{ndr}/Install%20and%20Update/Getting%20started/Version%206/Updating%20from%20v6%20to%20v7/01%20-%20Register%20Environment.md#basics-variables
[Step07]:{ndr}/Install%20and%20Update/Getting%20started/Version%206/Updating%20from%20v6%20to%20v7/07%20-%20Download%20and%20Update%20Monitoring%20Agents.md
[Step08]:{ndr}/Install%20and%20Update/Getting%20started/Version%206/Updating%20from%20v6%20to%20v7/08%20-%20Verify%20Functionality.md
[Step10]:{ndr}/Install%20and%20Update/Getting%20started/Version%206/Updating%20from%20v6%20to%20v7/10%20-%20Configure%20TLS.md
[Step13]:{ndr}/Install%20and%20Update/Getting%20started/Version%206/Updating%20from%20v6%20to%20v7/13%20-%20Final%20Cleanup.md
[Web API]:{ndr}/Core%20Services/Web%20API/Overview.md
[Web Client]:{ndr}/Getting%20Started/Overview.md