Contents

Upgrading and removing

How to upgrade a deployment and roll it back, and how prem remove takes away what setup registered, with or without the data.

01Upgrading

Back up the configuration (pg_dump --schema=prem_config -Fc), stop the API, replace the programs, run prem migrate with owner.credentials and then prem setup with the same options, and start the API. To roll back, put the old programs back, restore the configuration backup into a database whose two PremAgentic schemas you have dropped, run the old prem setup, and ingest again: the index is rebuilt from your documents. prem setup --plan lists what an upgrade would apply, including a generated text match function whose body is not this release's, which prem migrate reinstalls.

02Removing PremAgentic

prem remove takes away what prem setup registered and keeps your data. On Windows, from an elevated prompt, it stops and removes the Premagentic and PremagenticDb services. On Linux it prints the systemd steps for root to run and runs nothing as root itself. The database, its three roles, the credentials files and a bundled server's data folder all stay, and the output names each with its path, so running prem setup again picks them up.

shell01
prem remove --plan     # every step, nothing changed
prem remove            # the services go, the data stays

To delete the data as well:

shell02
prem remove --purge          # lists what would be deleted, changes nothing
prem remove --purge --yes    # deletes it

A purge drops the database as its owner, drops the three roles over setup's administrator connection (--admin-connection-file or PREM_SETUP_ADMIN_CONNECTION; a bundled server uses its own superuser), deletes a bundled server's data folder, and deletes the credentials files last. Every document, user, setting and the audit trail goes, and it cannot be undone. Anything that would stop the purge is found before anything is changed. A purge that stops part way can be run again.

Each line of output starts with a label a program can match: [removed], [plan], [kept], [manual], [none] or [FAILED]. Exit codes: 0 done or a plan, 1 a purge not confirmed or a step that failed, 2 refused before anything changed.