|
| 1 | +# Upgrading from v12 to v13.0 |
| 2 | + |
| 3 | +!!! warning "THIS RECIPE IS A WORK IN PROGRESS" |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +The steps listed in this article require an existing local installation of InvenioRDM v12. |
| 8 | + |
| 9 | +!!! warning "Backup" |
| 10 | + |
| 11 | + Always backup your database and files before you try to perform an upgrade. |
| 12 | + |
| 13 | +!!! info "Older Versions" |
| 14 | + |
| 15 | + In case you have an InvenioRDM installation older than v12, you can gradually upgrade |
| 16 | + to v12 and afterwards continue from here. |
| 17 | + |
| 18 | +## Upgrade Steps |
| 19 | + |
| 20 | +Make sure you have the latest `invenio-cli` installed. For InvenioRDM v13, it |
| 21 | +should be v1.5.0+ |
| 22 | + |
| 23 | +```bash |
| 24 | +$ invenio-cli --version |
| 25 | +invenio-cli, version 1.5.0 |
| 26 | +``` |
| 27 | + |
| 28 | +!!! info "Virtual environments" |
| 29 | + |
| 30 | + In case you are not inside a virtual environment, make sure that you prefix each `invenio` |
| 31 | + command with `pipenv run`. |
| 32 | + |
| 33 | +**Local development** |
| 34 | + |
| 35 | +Changing the Python version in your development environment highly |
| 36 | +depends on your setup, so we won't cover it here. |
| 37 | +One way would be to use [PyEnv](https://github.com/pyenv/pyenv). |
| 38 | + |
| 39 | +!!! warning "Risk of losing data" |
| 40 | + |
| 41 | + Your virtual environment folder a.k.a., `venv` folder, may contain uploaded files. If you kept the default |
| 42 | + location, it is in `<venv folder>/var/instance/data`. If you need to keep those files, |
| 43 | + make sure you copy them over to the new `venv` folder in the same location. |
| 44 | + The command `invenio files location list` shows the file upload location. |
| 45 | + |
| 46 | +If you upgraded your python version, you should recreate your virtual environment before |
| 47 | +running `invenio-cli` or `pipenv` commands below. |
| 48 | + |
| 49 | + |
| 50 | +### Upgrade InvenioRDM |
| 51 | + |
| 52 | +Python 3.9 or 3.11 or 3.12 is required to run InvenioRDM v12. |
| 53 | + |
| 54 | +There are two options to upgrade your system: |
| 55 | + |
| 56 | +#### Upgrade option 1: In-place |
| 57 | + |
| 58 | +This approach upgrades the dependencies in place. Your virtual environment for the |
| 59 | +v11 version will be gone afterwards. |
| 60 | + |
| 61 | +```bash |
| 62 | +cd <my-site> |
| 63 | + |
| 64 | +# Upgrade to InvenioRDM v12 |
| 65 | +invenio-cli packages update 13.0.0 |
| 66 | + |
| 67 | +# Re-build assets |
| 68 | +invenio-cli assets build |
| 69 | +``` |
| 70 | + |
| 71 | +#### Upgrade option 2: New virtual environment |
| 72 | + |
| 73 | +This approach will create a new virtual environment and leaves the v11 one as-is. |
| 74 | +If you are using a docker image on your production instance this will be the |
| 75 | +option you choose. |
| 76 | + |
| 77 | +##### Step 1 |
| 78 | +- create a new virtual environment |
| 79 | +- activate your new virtual environment |
| 80 | +- install `invenio-cli` by `pip install invenio-cli` |
| 81 | + |
| 82 | +##### Step 2 |
| 83 | +Update the file `<my-site>/Pipfile`. |
| 84 | + |
| 85 | +```diff |
| 86 | +[packages] |
| 87 | +---invenio-app-rdm = {extras = [...], version = "~=12.0.0"} |
| 88 | ++++invenio-app-rdm = {extras = [...], version = "~=13.0.0"} |
| 89 | +``` |
| 90 | + |
| 91 | +##### Step 3 |
| 92 | +Update the `Pipfile.lock` file: |
| 93 | + |
| 94 | +```bash |
| 95 | +invenio-cli packages lock |
| 96 | +``` |
| 97 | + |
| 98 | +##### Step 4 |
| 99 | +Install InvenioRDM v13: |
| 100 | + |
| 101 | +```bash |
| 102 | +invenio-cli install |
| 103 | +``` |
| 104 | + |
| 105 | +### Database migration |
| 106 | + |
| 107 | +Execute the database migration: |
| 108 | + |
| 109 | +```bash |
| 110 | +invenio alembic upgrade |
| 111 | +``` |
| 112 | + |
| 113 | +### Data migration |
| 114 | + |
| 115 | + |
| 116 | +Execute the data migration: |
| 117 | + |
| 118 | +### TODO |
| 119 | + |
| 120 | + |
| 121 | +### Rebuild search indices |
| 122 | + |
| 123 | +```bash |
| 124 | +invenio index destroy --yes-i-know |
| 125 | +invenio index init |
| 126 | +invenio rdm rebuild-all-indices |
| 127 | +``` |
| 128 | + |
| 129 | +From v12 onwards, record statistics will be stored in search indices rather than the |
| 130 | +database. These indices are created through some *index templates* machinery |
| 131 | +rather than having indices registered directly in `Invenio-Search`. As such, the |
| 132 | +search indices for statistics are not affected by `invenio index destroy |
| 133 | +--yes-i-know` and are totally functional after the rebuild step. |
| 134 | + |
| 135 | +### New roles |
| 136 | + |
| 137 | +### TODO |
| 138 | + |
| 139 | +### New configuration variables |
| 140 | + |
| 141 | +```bash |
| 142 | +from invenio_app_rdm import __version__ |
| 143 | +ADMINISTRATION_DISPLAY_VERSIONS = [ |
| 144 | + ("invenio-app-rdm", f"v{__version__}"), |
| 145 | + ("{{ cookiecutter.project_shortname }}", "v1.0.0"), |
| 146 | +] |
| 147 | +``` |
| 148 | + |
| 149 | +## Big Changes |
| 150 | + |
| 151 | +- feature: invenio jobs module, periodic tasks administration panel |
| 152 | +- feature: invenio vocabularies entries deprecation |
| 153 | +- improvement: search mappings and analyzers to improve performance |
| 154 | + |
| 155 | +### TODO |
| 156 | + |
| 157 | +## OPEN PROBLEMS |
| 158 | + |
| 159 | + |
| 160 | +### TODO |
0 commit comments