From 7b13382c460bc8798d2a8ea37b71137f897feb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Fri, 5 Jun 2026 21:33:09 +0200 Subject: [PATCH] [IMP] add migration log file to store all the migration logs. File reset at each migration. --- .gitignore | 1 + README.md | 17 +++++++++++++++-- upgrade.sh | 5 +++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 887b51d..0d8ff0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ final_404_addons +migration.log diff --git a/README.md b/README.md index 9371fc3..a8f1891 100644 --- a/README.md +++ b/README.md @@ -413,10 +413,23 @@ The script works on a **copy** of the original database. You can restart as many ### Viewing Detailed Logs -Odoo/OpenUpgrade logs are displayed in real-time. For a problematic migration: +All output (scripts, Docker containers, OpenUpgrade logs) is automatically saved to `migration.log` at the project root. The file is overwritten at the start of each run (full migration or resume). + +```bash +# Follow live output while also saving to file (already done automatically) +tail -f migration.log + +# Search for errors after the fact +grep -i error migration.log + +# View with ANSI colors preserved +less -R migration.log +``` + +For a problematic migration: 1. Note the version where the error occurs -2. Check the logs to identify the problematic module/table +2. Check `migration.log` to identify the problematic module/table 3. Add a fix in the `pre_upgrade.sh` for that version 4. Restart the migration diff --git a/upgrade.sh b/upgrade.sh index 6d9cdc1..564c19b 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -4,6 +4,10 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${SCRIPT_DIR}/lib/common.sh" +readonly LOG_FILE="${SCRIPT_DIR}/migration.log" +rm -f "$LOG_FILE" +exec > >(tee "$LOG_FILE") 2>&1 + #################### # USAGE & ARGUMENTS #################### @@ -225,3 +229,4 @@ log_step "POST-UPGRADE PROCESSES" "${SCRIPT_DIR}/scripts/finalize_db.sh" "$FINALE_DB_NAME" "$FINALE_SERVICE_NAME" log_step "UPGRADE PROCESS ENDED WITH SUCCESS" +log_info "Full logs available at: ${LOG_FILE}"