# Update and maintenance guide

Status: **manual process in 0.1.0.** The in-browser updater (validated package upload, automatic backup, rollback) is a later milestone and is not in this release. Do not trust any screen claiming otherwise.

## Backups (do this before every update)
1. cPanel > phpMyAdmin > select the database > Export > Quick > Go. Save the .sql file.
2. cPanel > File Manager > compress `rpms/storage/config.php` and `rpms/storage/uploads` and download.

## Manual update
1. Back up as above.
2. Upload the new ZIP, extract.
3. Replace `rpms/src`, `rpms/views`, `rpms/database`, `rpms/config`, `rpms/VERSION`, `rpms/bootstrap.php`, `rpms/cron.php` and the files in the public folder. **Never replace `rpms/storage`.**
4. Open Diagnostics. If "Pending migrations" is listed, a later release provides a one-click Apply button; in 0.1.0 pending migrations apply only through the installer logic, so do not skip releases.
5. Keep the previous folders renamed (e.g. `src.old`) for rollback.

## Rollback
Restore the old folders, and if a migration ran, import the pre-update database backup in phpMyAdmin.

## Routine
- Weekly database export.
- Check Diagnostics monthly: schema version, last scheduled run, trigger status.
- Review the Audit log for unexpected sign-ins.

## Emergency administrator access
Not built into the UI by design. With phpMyAdmin you can set a user's `password_hash` to a value created by PHP `password_hash()`; record that you did it. A supported reset tool is planned.
