Updating
Updates are installed from signed release packages. Every package is verified before a single file is touched, the previous version is kept until the update has finished, and a failed update rolls itself back.
Automatic check
The scheduler asks the update source once a day whether a newer version exists and tells the owners by email once per version. System → Updates shows the available version with its notes; Check now asks right away. The owner downloads and installs from there after confirming with their password and a two-factor code.
Installing from a package
- In the browser. System → Updates → Install from a package: upload the release zip. Large files are uploaded in chunks, so the usual upload limits of PHP do not apply.
- By FTP. Upload the zip into
storage/app/private/updates/incoming/and choose Scan the incoming folder on the same page. - From the command line.
php artisan twerplex:update --package=/path/to/twerplex-1.0.0-codecanyon.zip--checkonly reports whether a newer version is available,--forceskips the confirmation and--rollbackreverses an update that is in progress.
What happens during an update
- The package is checked: its signature against the release key built into the application, the edition, that the version is newer than the running one, the PHP minimum and the hash of every file.
- The site goes into maintenance mode (staff keep access through a cookie set when the update starts), automation is paused and a backup of the files that will change is taken.
- Files are replaced, database migrations run and caches are rebuilt.
.env,storage/,public/uploads/,extensions/andpublic/extensions/are never overwritten. - The site comes back, the update is recorded under System → Updates and the owners are told by email.
Updates are driven step by step from the browser or the command. If the browser is closed halfway, the scheduler's updates:resume task continues or rolls back within a minute.
Rollback
If a step fails, the files from the backup and the database (via the safety backup taken before migrations) are put back automatically and the reason is shown. The owner can also roll back deliberately from System → Updates while an update is in progress.
When the application cannot start
While files are being replaced, a small standalone script is kept at storage/framework/update-recovery.php. It needs nothing but PHP, so it works even when the application itself cannot boot:
php storage/framework/update-recovery.php status
php storage/framework/update-recovery.php rollback
Opening the site in a browser during that window shows the same status page with a rollback button for the owner. The script removes itself when the update ends.
Before updating
- Have a current backup (System → Backups).
- Read the release notes; migrations may take a while on large tables.
- Extensions and themes from other authors are left in place; check with their authors that they support the new version.