Skip to content

Migration workflow

Johnny Mariéthoz edited this page Sep 17, 2025 · 67 revisions

Migration workflow steps

Restore test

Index:

poetry run invenio rero es snapshot list backup |grep daily
poetry run invenio rero es snapshot restore backup XXXXXX
# rsync -avr --delete /network/nfs/files_prod/ /network/nfs/files/  --exclude=lost+found/
# chown -R ubuntu:ubuntu /network/nfs/files/*

DB kerosen

export kerosen

ssh root@kerosen
su - postgress
pg_dumpall > /database/backup/export/sonar.sql
exit
rsync -a /database/backup/export/sonar.sql root@malsen:/database/pgsql/
exit

ssh root@malsen
su - postgres
psql -f /database/pgsql/sonar.sql
exit
exit

# v1.11.0 --> v1.12.0

DB migration 9 -> 17 ???

Alembic

uv run invenio alembic upgrade
# TODO: uv run invenio rero es index update-mapping

ConfigMap

  • replace INVENIO_SQLALCHEMY_POOL_RECYCLE by INVENIO_SQLALCHEMY_ENGINE_OPTIONS: '{ "pool_recycle": 360 }'
  • set the config in the sqlalchemy container/server by setting PGOPTIONS to -c statement_timeout=30s -c idle_in_transaction_session_timeout=60s

Clone this wiki locally