Upgrade
Prerequisites¶
The steps listed in this article require an existing local installation of InvenioILS v6.
Backup
Always backup your database, statistics indices and files before you try to perform an upgrade.
Upgrade Steps¶
Upgrade to v7.0¶
Warning
The following steps should be performed before upgrading invenio-app-ils to v6.1.0
Version 7.0 introduces new statistics for loans.
For them to work correctly, search templates need to be created and updated before the indices are.
Thus, the following steps should be performed before upgrading invenio-app-ils to v7.0.0.
Circulation Loan Index¶
Add the following mapping to the existing index named loans-loan-v1.0.0-*.
"extra_data": {
"type": "object",
"dynamic": true,
"enabled": true
}
OpenSearch¶
This can be done in OpenSearch by navigating to the OpenSearch Dashboard > Index Management > Select the index > Mappings > JSON Editor.
Loan Transition Indices¶
Verify the templates don't already exist¶
GET _template/loan-transitions-v1.json
GET _template/aggr-loan-transitions-v1.json
Create the new templates¶
PUT _template/loan-transitions-v1.json
{
"index_patterns": [
"events-stats-loan-transitions-*"
],
"settings": {
"index": {
"refresh_interval": "5s"
}
},
"mappings": {
"date_detection": false,
"dynamic": false,
"numeric_detection": false,
"properties": {
"timestamp": {
"type": "date"
},
"updated_timestamp": {
"type": "date"
},
"unique_id": {
"type": "keyword"
},
"trigger": {
"type": "keyword"
},
"pid_value": {
"type": "keyword"
},
"extra_data": {
"type": "object",
"dynamic": true,
"enabled": true
}
}
},
"aliases": {
"events-stats-loan-transitions": {}
}
}
PUT _template/aggr-loan-transitions-v1.json
{
"index_patterns": [
"stats-loan-transitions-*"
],
"settings": {
"index": {
"refresh_interval": "5s"
}
},
"mappings": {
"date_detection": false,
"dynamic": false,
"numeric_detection": false,
"properties": {
"timestamp": {
"type": "date"
},
"updated_timestamp": {
"type": "date"
},
"trigger": {
"type": "keyword"
},
"count": {
"type": "integer"
}
}
},
"aliases": {
"stats-loan-transitions": {}
}
}
Upgrade InvenioILS¶
Now upgrade invenio-app-ils to v7.0.0.
(Optional) Add Stats to Loan Indfex¶
Create the indices¶
To create a new index extend a loan and process the events afterwards with
invenio stats events process
Enable Stats Indexing Feature Flag¶
Enable the feature flag ILS_EXTEND_INDICES_WITH_STATS_ENABLED = True in your configuration.
Reindex Loans¶
invenio index reindex -t loanid
invenio index run
Upgrade to v7.1¶
Version 7.1 introduces new statistics for orders and document requests.
They are optional and can be enabled with the feature flag ILS_EXTEND_INDICES_WITH_STATS_ENABLED.
Before enabling the flag the index mappings of orders and document requests need to be updated.
Orders¶
Update Index Mapping¶
Add the following mapping to the existing index named acq_orders-order-v1.0.0-*.
"stats": {
"type": "object",
"dynamic": true,
"enabled": true
}
Reindex¶
invenio index reindex -t acqoid
invenio index run
Document Requests¶
Update Index Mapping¶
Add the following mapping to the existing index named document_requests-document_request-v1.0.0-*.
"stats": {
"type": "object",
"dynamic": true,
"enabled": true
}
Reindex¶
invenio index reindex -t dreqid
invenio index run