Repository navigation
Installer: a rerun keeps the web backup of the release it upgraded from - #2003
Merged
mastacontrola merged 1 commit intoOct 28, 2026
Merged
Conversation
configureHttpd() names the web backup after the version being installed and removes any existing one first. A 1.5 -> 1.6 upgrade run twice therefore replaced the 1.5 tree with the 1.6 one, and revertfog.sh had no web tree left to restore. _setAsideOtherVersionWebBackup() reads the backup's own FOG_VERSION and, when it is another release, renames it after that release instead. A backup of the same release is still replaced. revertfog.sh finds the renamed one by its fog_web_*.BACKUP glob. The release notes said both backups are named after the version upgraded from, and that revertfog.sh runs from a 1.5 checkout. Neither was true: they carry the installed version, and the script exists only on 1.6. Refs #2000 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A second
installfog.shrun after a 1.5 -> 1.6 upgrade deletes the only 1.5 web-tree backup.bin/revertfog.shthen has no web tree to restore. Reported in #2000, part 2.Cause
configureHttpd()names the backupfog_web_${version}.BACKUP, where${version}is the version being installed. It removes any existing backup of that name before it copies the current tree in. On the rerun, the current tree is already 1.6, so the 1.5 copy is replaced.Fix
_setAsideOtherVersionWebBackup()runs before that removal. It reads the backup's ownFOG_VERSION(fromcommons/version.php,src/Base/System.php, or 1.5'slib/fog/system.class.php). If the backup holds another release, the function renames it tofog_web_<its version>.BACKUP, and adds a timestamp if that name is taken.revertfog.shfinds it by itsfog_web_*.BACKUPglob.Unchanged: a backup of the release being installed is still replaced, and a backup with no readable version takes the old path.
The release notes also said two wrong things (#2000, part 3):
revertfog.shfrom a 1.5 checkout. The script exists only on 1.6, and it reads 1.6'scommons/version.php.The notes now describe the real behavior.
Tests
tests/web-backup-keeps-other-release.test.sh, 9 checks. It runs the function against fixtures: the RC-19 test report: upgrade from 1.5.10.2518 fails on the first pass (schema 290), and a rerun deletes the 1.5 web backup #2000 rerun, a taken name, a 1.6 tree's version file, the same release, and no backup. With the rename disabled, 4 of the 9 checks fail.revertupdate,revert-refuses-without-dump,webroot-preserved-files,unrecognized-plugin-noticeandclient-repin-warningpass.Refs #2000
🤖 Generated with Claude Code