# Uninstall

## Application

```powershell
npm run stop:sovereign
```

## Repository database

```powershell
.\scripts\uninstall-sovereign.ps1 -SqlServer . -DropDatabase -Confirm:$false
```

## Optional cleanup

```powershell
.\scripts\uninstall-sovereign.ps1 -SqlServer . -DropDatabase -RemoveLocalReleases -DropCollectorLogin -Confirm:$false
```

## Manual steps

1. Remove SQL Agent jobs if you created any for scheduled collection
2. Revoke collector login on target instances (`dbaops_collector`)
3. Remove API service account from `dbaops_sovereign_app` role
4. Delete install directory

## Cold-proof databases

`deploy-cold.ps1` creates `SovereignRepository_ColdProof` temporarily and drops it unless `-KeepDatabase` is passed.
