CERNDocumentServer / cds-ils

CERN Library integrated library system.
https://catalogue.library.cern
MIT License
8 stars 14 forks source link

Write upgrade recipe #885

Open kpsherva opened 3 weeks ago

kpsherva commented 3 weeks ago

For the upcoming deployment we need to make sure we are able to correctly update from current version to next one (due to data model changes). For example we need to add new fields to the mappings on sandbox and prod. Is there anything else we need to remember to deploy the latest batch of issues? (see https://github.com/inveniosoftware/invenio-app-ils/pull/1205#pullrequestreview-2011013939) the upgrade instruction can be stored here

kpsherva commented 4 days ago
  1. document and item mapping addition: invenio index update items-item-v1.0.0 <-- does not work, do via opensearch invenio index update documents-document-v1.0.0

              "identifiers": {
                "properties": {
                  "scheme": {
                    "type": "keyword"
                  },
                  "value": {
                    "type": "keyword"
                  }
                },
                "type": "object"
              },
  2. invenio vocabulary index json --force cds_ils/vocabularies/data/shelf_numbers.json

  3. create new index

    from invenio_search.proxies import current_search
    x = current_search.create(ignore_existing=True, index_list=["eitems-eitem-v2.0.0"])
    list(x)
  4. make sure it exists in opensearch

  5. run https://gitlab.cern.ch/cds-team/production_scripts/-/blob/master/clc/bulk_update_eitems_with_types.py?ref_type=heads

  6. reindex eitems

    invenio index reindex -t eitmid
    invenio index run
  7. make sure the eitems are updated (side effect: thy are displayed twice in search)

  8. invenio index delete eitems-eitem-v1.0.0-

  9. reindex physical items and docs

    invenio index reindex -t pitmid
    invenio index run
    invenio index reindex -t docid
    invenio index run
kpsherva commented 4 days ago

invenio vocabulary index json --force cds_ils/vocabularies/data/eitem_sources.json