Skip to content

Uninstalling OpsIQ ​

Uninstalling removes one OpsIQ instance from the IBM i: it stops that instance's services and deletes its install directory. It is scoped to a single instance — any other OpsIQ instances on the box are left untouched — and, like install, it runs from your workstation over SSH.

What gets removed ​

By default, uninstall:

  • stops the instance's PM2 services (tools, AI server, web UI as applicable);
  • removes its install directory, including chat history and logs;
  • removes the instance's entry from the instance registry that OpsIQ keeps in its license library. Other instances' entries are left alone. If the install directory is already gone, uninstall still removes this entry, and tells you it found no install directory to remove.

It deliberately leaves some things behind:

  • the instance's license library and the service profile the services ran under — kept because they can be shared with other instances or reused for a later reinstall (the flags below remove them too);
  • any pre-upgrade snapshots. If the instance was ever upgraded, the installer keeps a few snapshots of the previous install next to it (at <install-root>.backup.<timestamp>), and uninstall does not remove them.

Snapshots keep chat history and credentials on the box

Because uninstall leaves the snapshots, up to a few full copies of the earlier install tree — each including the chat database and the configuration .env — can remain. If you are uninstalling to reclaim disk, or to remove OpsIQ for compliance reasons, delete the <install-root>.backup.* directories by hand as well. See Upgrading for how many snapshots are kept and how to bound them.

Uninstalling the default instance ​

For a standard install you only need the instance name — the installer derives the rest. From your workstation, in the folder you unzipped the installer into (see Get the installer):

bash
./opsiq-install uninstall --host your-ibm-i.example.com --ssh-user YOURPROFILE --instance opsiq
powershell
.\opsiq-install.exe uninstall --host your-ibm-i.example.com --ssh-user YOURPROFILE --instance opsiq
bash
./opsiq-install.exe uninstall --host your-ibm-i.example.com --ssh-user YOURPROFILE --instance opsiq

No license key or Anthropic key is needed to uninstall. Before changing anything, the installer prints what it will remove and asks you to type the instance name to confirm (a blank or wrong answer aborts). Add --dry-run to preview the plan (see Options), or --yes to skip the prompt for an unattended run.

Use the command the installer gave you

At the end of a successful install, the installer prints the exact uninstall command for that instance — including the right --install-root. Keep that line to tear the instance down later. Note that the printed command ends in --yes, so it runs without the type-the-instance-name confirmation — drop --yes if you would rather be prompted to review first.

Options ​

  • --instance — which instance to remove (default opsiq). The install directory is derived from this name, so use the same spelling you installed with. Case does not matter: instance names are folded to lowercase, so --instance OPSIQ and --instance opsiq are the same instance.
  • --install-root — the directory is normally derived from the instance name (/QOpenSys/opsiq/<instance>); pass this only if you installed to a custom directory. If the derived directory is not found, the installer tells you rather than silently doing nothing.
  • --drop-library — also remove the instance's own license library. The shared default library OIQ1 is never dropped — and because OIQ1 is the library the default opsiq instance uses, this flag has no effect for opsiq. It only removes a non-default instance's dedicated library.
  • --delete-profile — also delete the dedicated service profile. This applies only to a managed install; on a direct install the services run under your own login profile, so there is no dedicated profile and the flag does nothing. Because a profile can be shared across instances, the installer confirms it with a separate prompt — type the profile name to delete it, or press Enter to skip just the profile and keep the rest of the uninstall. The job description is left in place. Deleting the profile is best-effort: if the profile still owns objects (for example, another instance's files) or has active jobs, it is not deleted — the uninstall reports what is still blocking it and otherwise completes normally.
  • --yes — skip the confirmation prompt (required for an unattended uninstall).
  • --dry-run — print the commands uninstall would run, but change nothing. It does not connect to the IBM i, so nothing on the box is checked — not even that the instance is actually there.

Removing the profile and library too ​

To extend a teardown to the instance's shared resources, add --drop-library and --delete-profile, with --yes to run it unattended. It spans two lines, so — as on the Install page — the line-continuation character differs by terminal too (\ on macOS/Linux, a backtick on PowerShell, ^ on Command Prompt):

bash
./opsiq-install uninstall --host your-ibm-i.example.com --ssh-user YOURPROFILE \
  --instance opsiq --drop-library --delete-profile --yes
powershell
.\opsiq-install.exe uninstall --host your-ibm-i.example.com --ssh-user YOURPROFILE `
  --instance opsiq --drop-library --delete-profile --yes
bat
.\opsiq-install.exe uninstall --host your-ibm-i.example.com --ssh-user YOURPROFILE ^
  --instance opsiq --drop-library --delete-profile --yes
bash
./opsiq-install.exe uninstall --host your-ibm-i.example.com --ssh-user YOURPROFILE \
  --instance opsiq --drop-library --delete-profile --yes

What this actually removes depends on the instance:

  • --drop-library drops the instance's own library — but for the default opsiq instance the library is the shared OIQ1, which is never dropped, so the library is kept regardless. The flag removes only a non-default instance's dedicated library.
  • --delete-profile removes the dedicated service profile on a managed install, and needs an SSH user with authority to delete a profile. It is confirmed by its own prompt (above), which --yes skips.

If you only plan to reinstall later, you do not need either flag — a plain uninstall leaves the library and profile ready to reuse. Note that neither flag touches the pre-upgrade snapshots described above.