Himanshu SharmaSoftware engineer
Let’s talk

CodeIgniter 4 · Lesson 29 of 30

CodeIgniter maintenance: reproduce dependencies and rehearse recovery

Plan controlled dependency maintenance and recovery rehearsals while distinguishing a backup file, a code rollback and a compatible restored application.

15 minDelivery and final projectUpdated 14 November 2026

Awaiting technical review. This lesson is readable but not yet listed in search engines.

By the end of this lessonPlan controlled dependency maintenance and recovery rehearsals while distinguishing a backup file, a code rollback and a compatible restored application.

After this lesson you can plan a maintenance change as a controlled experiment with a reproducible dependency state and a recovery check. A deployed application continues to change: dependencies receive updates, configuration evolves and stored data grows. Maintenance is not a one-time command that makes the application permanently safe.

Know the state you are changing

Record the application revision, framework version, PHP runtime and dependency lock state before a planned change. For this course the verified framework is CodeIgniter 4.7.6, with PHP 8.4.24 and Composer 2.10.2, as of 2026-11. A future maintenance task must inspect its own actual versions instead of treating these as eternal current versions.

A manifest describes acceptable dependencies; the lock file records the selected resolution. Changing one without understanding the other can make a release irreproducible. Composer's validation command checks the project definition and consistency conditions, while application tests check behavior. Neither replaces the other.

bash
composer validate --strict
vendor/bin/phpunit --no-coverage --filter CatalogueTest

These commands were executed in the temporary development-capable bookshop workspace. Example output captured on 2026-11; yours will differ. Incidental progress, paths and timing are omitted.

text
./composer.json is valid
OK (6 tests, 10 assertions)

Strict manifest validation does not certify the correctness of every dependency, and six passing tests cover only their stated assertions. Maintenance needs an honest reading of evidence rather than a broad claim that one green command proves everything.

Upgrade in a separate rehearsal

Read the official changelog and upgrade instructions for the exact versions involved. Do not blindly copy development documentation into a stable application. Framework updates can require application-file changes as well as replacing packages, because the starter includes files owned by the project.

Try the change in a disposable or staging workspace with nonprivate data. Preserve the previous lock file and application revision so that you can reconstruct the prior dependency set. Do not edit vendor to work around a failure and then forget that reinstalling dependencies removes the patch.

This lesson does not run a version update or claim compatibility with an uninstalled future release. The course has verified one stable framework installation. A proposed upgrade would be new work with its own requirements, commands and tests.

Rehearse recovery, not only backup creation

A backup is useful only if you can restore the required state. For the bookshop, that can include the database, private uploads and the configuration needed to interpret them. Application code and dependency metadata are another part of the recovery set. Store secrets through the appropriate secure operational process rather than putting them into a public archive.

SQLite backup consistency depends on how writes and database files are handled. Do not casually copy an actively changing database file and promise it is a complete recoverable snapshot. Use a documented consistent backup approach for the deployment and verify restoration in an isolated environment. This course does not prescribe an unverified host-specific backup command.

Restoring only code may leave a schema created by newer migrations. Restoring only the database may leave uploads or application expectations out of sync. Define which combinations are compatible before an incident, and record the restoration order.

Keep a small operational notebook

Useful notes identify the change, expected behavior, verification evidence and recovery path. For example, a title-validation adjustment should include accepted and rejected cases, while an upload change should include stored-file effects. Notes should not contain copied tokens or complete environment dumps.

Review logs for actual failures and manage retention deliberately. A growing log directory can consume storage; deleting everything whenever a problem occurs removes evidence. Keep operational information private and choose retention according to the application's needs and applicable requirements.

Review boundaries after feature changes

Adding a new API action, import command or media endpoint can bypass a policy that previously covered only browser forms. Repeat the route inventory and ask where input is validated, permission is checked and output is rendered. A safe old feature does not automatically protect a new entry point.

The fetched official Deployment guide, Configuration guide and Composer basic usage support the dependency and caching distinctions. The recovery planning here is established operational practice, not a claim that a particular hosting product has been configured or tested.

Common mistakes

Updating dependencies directly on a live host combines discovery with release risk. Treating a backup file as proof of recovery skips restoration. Reverting code while ignoring schema compatibility can leave an unusable application. Finally, adding an import route without reviewing the existing permission boundary creates a new path around controls that were correct for earlier forms.

Exercise

A release changes the schema and starts storing private cover files. Explain why restoring yesterday's code alone may not recover the application. Name the evidence you would want from a rehearsal before declaring the recovery plan usable.

Show an answer

Older code may not understand the new schema, and the database may reference cover files absent from the restored storage. A useful rehearsal restores compatible code, dependencies, database and required uploads into an isolated environment, then verifies catalogue reads, expected access denial and the intended file behavior without using production secrets or records.

Previous lesson · Next lesson · Related: explicit routes · Related: security boundaries

Key points

  • Record actual versions and dependency state before changing them.
  • A backup needs a successful restoration rehearsal.
  • Review new entry points against existing validation and permission boundaries.

Check yourself

1. Does reverting code necessarily revert the schema?
2. What evidence makes a backup useful?
3. Where should an upgrade be tried first?