Church Cashbook
Maintenance Manual
Manual home Return to Church Cashbook

Church Cashbook Maintenance Manual

Checklist-driven procedure for safe planned maintenance, using the 503 maintenance page and maintenance.on toggle.

⚠ Critical pre-maintenance requirement

Always create a full backup of the following before implementing any planned maintenance:

  • The complete site codebase
  • The database schema
  • All data within the database

This backup must be taken after the system has been placed into maintenance mode (offline to users) and before any planned procedures are carried out.

Planned maintenance procedure

Overview

Planned maintenance should be handled in a controlled way to protect financial data integrity and ensure a predictable return to service. Maintenance mode is enabled using a file-based toggle (maintenance.on) in the web root, which redirects all requests to the standalone 503.php page.

Pre-maintenance checklist

Enable maintenance mode

  1. Create an empty file in the web root: maintenance.on.
  2. Confirm any page now returns HTTP 503 (Service Unavailable).
  3. Confirm the 503 page renders correctly and does not depend on the database.
  4. Confirm the system is effectively read-only / unavailable to users during the maintenance window.

File and directory permissions (after install or upgrade)

After deploying new code (or changing the server configuration), ensure filesystem permissions are correct. This reduces the risk of accidental data exposure and prevents the web server from writing to application code.

⚠ Important

Run these commands from the project root (the folder that contains app/, public/, modules/). Only change permissions on files you own. Avoid changing ownership (chown) unless you fully understand the hosting environment.

Recommended permissions

Commands (run from project root)

# 1) Directories: read/execute for all, write for owner only
find . -type d -exec chmod 755 {} \;

# 2) Code files: readable by all, writable by owner
find . -type f -name "*.php"  -exec chmod 644 {} \;
find . -type f -name "*.js"   -exec chmod 644 {} \;
find . -type f -name "*.css"  -exec chmod 644 {} \;
find . -type f -name "*.html" -exec chmod 644 {} \;

# 3) Sensitive files (adjust paths if config is moved outside web root)
chmod 600 app/config.php 2>/dev/null || true
find . -name ".htaccess" -exec chmod 644 {} \;

# 4) Runtime directories (only if present / used)
chmod 755 logs 2>/dev/null || true
chmod 755 logs/exports 2>/dev/null || true
chmod 755 public/uploads 2>/dev/null || true

# 5) Quick safety check: list world-writable files/dirs (should return nothing)
find . -perm -002 -ls

After running these, re-check System information (Super Admin) to confirm there are no world-writable paths and that runtime folders required by the application are writable.

PHP error display (display_errors) — production safety check

Before returning the service to users, confirm that PHP errors are not displayed in the browser. This is often enabled in development environments (useful for debugging), but it should be disabled on a live system.

⚠ Important

If display_errors is enabled in production, users may see PHP warnings and fatal errors. These messages can reveal internal file paths and system details. This is a security risk and looks unprofessional.

Required production settings

How to check

  1. Go to Admin → System information → Key PHP settings.
  2. Confirm display_errors shows Off (recommended for production).
  3. Confirm log_errors is enabled and note the error_log location if shown.

If correction is required

These settings are usually controlled by the server (php.ini, hosting control panel, or Apache/PHP configuration). After making changes, restart Apache/PHP if required, then re-check System information.

Final validation before returning to service

During maintenance

Post-maintenance checklist

  1. Delete the maintenance.on file.
  2. Confirm normal routing resumes (HTTP 200 on standard pages).
  3. Confirm login works.
  4. Confirm dashboard loads.
  5. Perform a quick smoke test:
    • ☐ Add a test transaction (and void/remove if appropriate).
    • ☐ Run a standard report (e.g. Monthly Summary).
    • ☐ Check church selection and scope behaves correctly.
    • ☐ Check Gift Aid (if applicable to your environment).
  6. Clear or reset /503.php operator text ($expectedResume, $extraNote) if you set it.
  7. Record a maintenance summary (what changed, start/end times, any issues, and confirmation of success).

Maintenance record template

Date: ____________________________

Start time: _______________________    End time: _______________________

Reason: ______________________________________________________________

Changes applied: ______________________________________________________

Backup location: ______________________________________________________

Rollback required? ☐ Yes ☐ No

Issues encountered / actions:

______________________________________________________________

______________________________________________________________