# GOVIX cPanel cumulative update

This cumulative update contains the current application code, compiled frontend, production Composer dependencies, all Laravel migrations, and a one-time browser migration utility. It contains no local `.env`, database password, SQLite database, production data SQL, logs, sessions, or uploaded customer documents.

## Update an existing installation

1. Back up the existing cPanel database and application files.
2. Confirm the server `.env` is beside `artisan`, uses the production MySQL or MariaDB database, and has `APP_DEBUG=false`.
3. Upload the ZIP into the existing private GOVIX project root—the directory containing `artisan`—and extract it with overwrite enabled. Do not delete the existing project first.
4. Do not replace the server `.env`. The archive does not contain `.env`; `.env.cpanel.example` is reference-only.
5. Existing `storage/app` uploads remain in place because the archive contains no customer uploads. Make `storage` and `bootstrap/cache` writable by the PHP user. Typical directory permissions are `0755`; use `0775` only when required by the host.
6. In cPanel File Manager, open `storage/app/private/INSTALL_TOKEN.txt` and copy the one-time token.
7. Visit `https://YOUR-DOMAIN/cpanel_migrate.php`, enter the token, type `MIGRATE`, and submit. The utility verifies the configured database, applies only pending Laravel migrations with `--force`, rebuilds production caches, deletes the token files, creates a lock receipt, and renames itself to `cpanel_migrate.php.disabled` when the host permits it.
8. Test login and the customer, company, employee, application, and expiry workflows.
9. Delete `public/cpanel_migrate.php.disabled` after confirming the application works. Keep `storage/app/private/cpanel_migration.lock` as the update receipt.

The update archive intentionally has no SQL dump with `DROP TABLE` statements. Never import a local database dump over an existing production database for this update.

## New installation

For a new installation, create an empty MySQL or MariaDB database and user with all privileges, copy `.env.cpanel.example` to `.env`, enter the cPanel settings, point the domain document root to `/home/CPANEL_USER/govix/public`, and then run the same browser migration utility. It creates `APP_KEY` when the key is blank.

## cPanel cron jobs

Run the scheduler every minute, replacing the account and application paths:

```text
* * * * * /usr/local/bin/php /home/CPANEL_USER/govix/artisan schedule:run > /dev/null 2>&1
```

If the hosting plan does not provide a persistent queue worker, process queued jobs every minute:

```text
* * * * * /usr/local/bin/php /home/CPANEL_USER/govix/artisan queue:work --stop-when-empty --tries=3 --timeout=120 > /dev/null 2>&1
```

The exact PHP binary may be `/usr/local/bin/php`, `/usr/bin/php`, or a cPanel EasyApache path. Select PHP 8.2 or newer and enable PDO MySQL, Mbstring, OpenSSL, Tokenizer, XML, Ctype, JSON, Fileinfo, and DOM.

## Recovery

If the browser migration fails, read `storage/logs/cpanel-migrate.log`, correct `.env` or permissions, and retry. A failure does not create the installer lock. Never enable `APP_DEBUG` on the public production domain.
