Nothing Special   »   [go: up one dir, main page]

Skip to content

Upgrading from v1.0 to v2.0

Prerequisites

The steps listed in this article require an existing local installation of InvenioRDM 1.0, please make sure that this is given!
If unsure, run invenio-cli install from inside the instance directory before executing the listed steps.

Note: Do not delete the old Python virtual environment, or the database migration may complain about missing packages.

Upgrade Steps

First, the current state of the database has to be determined (for the database migration to work). Then, the new release must be installed and the database has to be migrated. At last, the records need to be migrated the Elasticsearch indices have to be rebuilt.

This can be achieved by the following shell commands:

# NOTE: make sure you're in the instance directory
# upgrade packages
rm Pipfile.lock
sed -e 's/1.0.0/2.0.0/' -i Pipfile
invenio-cli packages lock
invenio-cli install

# do the migration
pipenv run invenio alembic upgrade
pipenv run invenio shell $(find $(pipenv --venv)/lib/*/site-packages/invenio_app_rdm -name migrate_1_0_records_to_2_0.py)
pipenv run invenio index destroy --yes-i-know
pipenv run invenio index init
pipenv run invenio rdm-records rebuild-index

Alternatively, just download and copy the upgrade script into the instance directory, and execute it.

Troubleshooting

This Troubleshooting guide is intended to solve known issues that might appear after upgrading from v1.0 to v2.0.

Prerequisites

Have executed an upgrade from v1.0 to v2.0 following the instructions in the previous section.

Resolving known errors

Error deleting a draft

Problem: When deleting a draft an SQLAlchemy error will happen in the server and it won't work.

Cause: This is caused by an Invenio module (invenio-pidrelations) that is not used anymore and is a left over from the previous version.

Solution: Remove the unused module. This can be achieved by the following shell command:

pipenv run pip uninstall invenio-pidrelations

Record versions error

Problem: When creating a new version on a migrated record, the second version appears as "Version v1".

Cause: This is caused by an incomplete migration of the records.

Solution: Download the python script, execute it and rebuild the indices. This can be achieved by the following shell commands:

pipenv run invenio shell <path_to_downloaded_script>
pipenv run invenio index destroy --yes-i-know
pipenv run invenio index init
pipenv run invenio rdm-records rebuild-index

Edits

March 3rd, 2022: Removed the invenio alembic stamp command from the upgrade guide, because the command does not actually find out the current revisions for the database.