Files
coolify/scripts/transfer-test/snapshot.sh
T
Andras Bacsai c454f84545 fix(server-transfer): keep imported data exact and guard archived servers
- Skip TrimStrings and ConvertEmptyStringsToNull on the import route; an empty shared variable failed the whole import
- Keep compose parser versions, static ports, legacy variable keys, and only the bundle's variables and destinations
- Give the transfer back token the deploy permission that the import needs
- Move the Cloudflare tunnel DNS record with the server and park it on the source
- Refuse cloud server deletes, power on, tunnel and DNS changes, and scp for archives; skip their backup alerts and provider polling
- Add a column-level round-trip test, archive guard tests, and a live full-coverage transfer test
- Advance the GitLab App sequence in the dev seeder
2026-10-22 15:52:20 +02:00

13 lines
635 B
Bash
Executable File

#!/usr/bin/env bash
# Write the portable snapshot of a server (see snapshot.php) on the source (A) or the target (B) to a file.
#
# Usage: scripts/transfer-test/snapshot.sh A|B <server uuid> <output file>
source "$(dirname "$0")/lib.sh"
[[ $# -eq 3 ]] || die 'Usage: snapshot.sh A|B <server uuid> <output file>'
C="$A"
[[ "$1" == B ]] && C="$B"
docker cp "$TT_DIR/snapshot.php" "$C:/tmp/snapshot.php" >/dev/null
docker exec -u www-data "$C" php artisan tinker --execute "\$snapshotServer = '$2'; \$snapshotOut = '/tmp/snapshot.json'; require '/tmp/snapshot.php';" 2>&1 | grep -v '^$'
docker cp "$C:/tmp/snapshot.json" "$3" >/dev/null