Skip to content

Upgrading & Uninstalling

AI ships with self-healing schema checks (ai:doctor) for upgrades and a complete cleanup routine in Ai::___uninstall() when removing the module.

Always take a database backup (php vendor/bin/wire db:backup) before upgrading in production.

  1. Update the package and refresh modules so ProcessWire runs ___upgrade() automatically:

    Terminal window
    composer update trk/processwire-ai
    php vendor/bin/wire module:refresh
    php vendor/bin/wire ai:doctor --json
  1. Remove $ai / Ai::requireInstance() / renderChatWidget() calls from your templates and custom site/ai/assistants/ classes, and remove any InputfieldAiChat fields from your templates.

  2. Uninstall companion modules and Ai:

    Terminal window
    php vendor/bin/wire module:uninstall InputfieldAiChat
    php vendor/bin/wire module:uninstall ProcessAi
    php vendor/bin/wire module:uninstall Ai
  3. Remove the Composer package (optional):

    Terminal window
    composer remove trk/processwire-ai

What Ai::___uninstall() Cleans Up Automatically

Section titled “What Ai::___uninstall() Cleans Up Automatically”

When Ai::___uninstall() executes, it removes:

  • All 3 AiTables SQL tables (entries_tbl_ai_usage_logs, entries_tbl_ai_conversations, entries_tbl_ai_mcp_logs).
  • All 7 AiBlueprints (ai-connections, ai-settings, ai-assistants, ai-rules, ai-voices, ai-glossaries, ai-mcp-keys) and their stored entries.
  • The local vector store and cache directory site/assets/cache/ai/ (including vectors.sqlite) and generated artifact directory site/assets/cache/ai-artifacts/.
  • All 5 RBAC permissions (ai-admin, ai-use, ai-translate, ai-image, ai-audit).

Next steps