# Updating RustSearch

Update the existing plugin in place. Do not uninstall it.

Upload the new KPZ, open Configuration → Update RustSearch and copy the current
bundle's SSH command with its Copy button. The page fills in the name of the
Koha instance it belongs to; if it shows INSTANCE instead, replace that with the
intended Koha instance name.
Run as the normal administrator with sudo access; the web page does not execute
server updates.

Use --check-only to inspect prerequisites and engine compatibility. Use --update
when updating the engine and plugin. It builds and tests the bundled executable,
backs up the deployment, installs matching components and verifies native search.
Compatible same-schema updates retain existing indexes. A schema-6 engine is
not updated with --update: run setup with --rebuild-index instead. It installs
the schema-7 engine, moves the old index aside and rebuilds the index from the
catalog. Searches use the fallback engine (Zebra if none is chosen) until the
rebuild completes, then return to RustSearch automatically. Preserve printed
backup paths and logs. Expect a brief search interruption during the switch.

To update several instances on the same server, upload the KPZ in each instance,
then run the update command once with --instances followed by the instance names
in place of INSTANCE, for example --instances library1 library2 --update. The
engine is built and tested once and reused for every listed instance. Instances
are updated one at a time; the run stops at the first failure and reports which
instances were completed.

Building the engine needs about 5 GB of free space in your home directory. The
launcher checks free space before extracting anything (--check-only reports it
too) and stops with a clear message when there is not enough. Logs are written to
~/rustsearch-logs/. After a successful run the temporary rustsearch-setup.* build
folder and the launcher copy are removed. After a failure the build folder is kept
for investigation and the launcher prints the command to remove it. Folders left
by earlier runs are reported with their size but never removed automatically.

A KPZ upload alone does not replace the engine executable. Use --existing-engine
only when the release instructions do not require a new executable: it refreshes
the plugin, worker and Koha integration while retaining the current engine and
indexes. Engine changes are not applied in that mode. It is not a transactional
engine replacement; completed steps may remain installed if a later step fails.

The updater preserves the effective service account, index paths, native port and
enabled optional features. Optional components stay disabled unless explicitly
enabled. Follow version-specific requirements and validate staff/OPAC searches,
indexing status and enabled features afterward. Production engines and indexes
must remain on schema 7 or newer. Backups of installation files do not undo catalog
edits. Retain the current SearchEngine selection through a compatible update.

Setup also checks native authority initialization. Missing authority records are
queued with change capture enabled; existing acknowledged records and MARC are
preserved. Review authority initialization and retry status before SELECTING
RUSTSEARCH IN SEARCHENGINE. The updater preserves SearchEngine; it never switches
to another backend automatically. Bibliographic indexing completeness remains
diagnostic, separate from initial authority-query readiness.

Automatic indexing schedules are installed or repaired during setup and updates.
An explicit operator pause remains in force and is reported. Add
`--resume-authorities` to the current bundled command when you intend to resume
paused authority processing. A bounded initial batch starts after update locks
release; scheduled workers continue larger backlogs. Review initialization and
retry status separately from installation success.
