Skip to content

Commit 7532327

Browse files
committed
fix: create /data/compose compat symlink for legacy stacks after migration
Legacy compose stacks reference /data/compose/* for bind mounts, but the migration only copies data to ${data_root}/compose without creating a path alias. When containers restart, Docker cannot resolve the original /data/compose/... paths and fails. After the transform successfully copies data: 1. Rename /data/compose → /data/compose.legacy-bak (preserve for rollback) 2. Create symlink /data/compose → ${data_root}/compose This matches the /data → ${data_root} compat symlink inside the product container.
1 parent 298dcab commit 7532327

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

install/lib/upgrade-legacy.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,16 @@ _legacy_transform_volumes() {
484484
die "$EXIT_RUNTIME" "Legacy data transform failed"
485485
fi
486486
rm -rf "$tmpdir"
487+
488+
# After transform, create a compat symlink so legacy compose stacks
489+
# that still reference /data/compose/* can find their bind-mount sources.
490+
# The real data now lives under ${data_root}/compose.
491+
if [ -d /data/compose ] && [ ! -L /data/compose ] && [ -d "${data_root}/compose" ]; then
492+
log_step "Creating /data/compose → ${data_root}/compose compat symlink for legacy stacks"
493+
mv /data/compose /data/compose.legacy-bak
494+
ln -s "${data_root}/compose" /data/compose
495+
log_info "Legacy /data/compose preserved at /data/compose.legacy-bak"
496+
fi
487497
}
488498

489499
# Import staged legacy runtime settings into the modern config model.

0 commit comments

Comments
 (0)