Skip to content

Installer: a rerun keeps the web backup of the release it upgraded from - #2003

Merged
mastacontrola merged 1 commit into
working-1.6from
fix/upgrade-rerun-backup-and-rehearsal
Oct 28, 2026
Merged

mastacontrola merged 1 commit into
working-1.6from
fix/upgrade-rerun-backup-and-rehearsal

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Problem

A second installfog.sh run after a 1.5 -> 1.6 upgrade deletes the only 1.5 web-tree backup. bin/revertfog.sh then has no web tree to restore. Reported in #2000, part 2.

Cause

configureHttpd() names the backup fog_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 own FOG_VERSION (from commons/version.php, src/Base/System.php, or 1.5's lib/fog/system.class.php). If the backup holds another release, the function renames it to fog_web_<its version>.BACKUP, and adds a timestamp if that name is taken. revertfog.sh finds it by its fog_web_*.BACKUP glob.

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):

  • They said both backups are named after the version upgraded from. Both carry the version being installed.
  • They said to run revertfog.sh from a 1.5 checkout. The script exists only on 1.6, and it reads 1.6's commons/version.php.

The notes now describe the real behavior.

Tests

Refs #2000

🤖 Generated with Claude Code

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>
@fog-workflows
fog-workflows Bot enabled auto-merge October 28, 2026 18:22
@mastacontrola
mastacontrola added this pull request to the merge queue Oct 28, 2026
Merged via the queue into working-1.6 with commit b332efb Oct 28, 2026
11 checks passed
@mastacontrola
mastacontrola deleted the fix/upgrade-rerun-backup-and-rehearsal branch October 28, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant