Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

# Voraussetzung: Q3 2020 Hotfix #2 (oder Hotfix #3) ist installiert.
# Annahme: der Standard-Mandant (hier: diku) ist abgesichert (supertenant-Modul mod-authoken a); ansonsten entfallen einige Schritte dieser Anleitung
# Snapshots der beteiligten Rechner machen (lassen): folio-server (Frontend, Backend-Module, Okapi), dbserver (Postgres-DB)
# Datenbankinhalte sichern auf dbserver
  ssh folio@dbserver
  cd db-backup
# Dump all roles on the source database
  pg_dumpall -g > roles.psql
# Dump Database contents
  pg_dump okapi > okapi.psql
  pg_dump folio > folio.psql


# Für Ubuntu-Server: Vielleicht erstmal Ubuntu hochziehen. Vor einem Release-Upgrade sollte man das machen, falls zwischendurch nicht geschehen.

  ssh folio@folio-server
# Welcome to Ubuntu 18.04.5 LTS

  sudo apt-get update
  sudo apt-get upgrade
  sudo apt dist-upgrade
# Evtl. sogar Ubuntu Release-Upgrade machen:
  sudo reboot
  sudo do-release-upgrade
    Checking for a new Ubuntu release...
# Ubuntu Upgrade auch auf folio-hbz1-dbserver
  ssh folio@dbserver
  sudo apt-get update
  sudo apt autoremove
  sudo apt-get upgrade
  sudo apt dist-upgrade
  sudo reboot

# ***************************************************************************************************************
# Upgrade der Okapi-Version (das muss man machen! Sonst kann man die neuen Module nicht ziehen) / Neustart Okapi
# ****************************************************************************************************************
# Installieren und konfigurieren Sie Okapi
# Importieren Sie den FOLIO-Signaturschlüssel, fügen Sie das FOLIO apt-Repository hinzu und installieren Sie Okapi (dieser Version).
  ssh folio@folio-server
  mkdir /usr/folio/upgrade
# okapi.conf sichern:
  sudo su
  cp -p /etc/folio/okapi/okapi.conf /usr/folio/upgrade/
#
  wget --quiet -O - https://repository.folio.org/packages/debian/folio-apt-archive-key.asc | sudo apt-key add -
OK
  sudo add-apt-repository "deb https://repository.folio.org/packages/ubuntu focal/"
  sudo apt-get update
  sudo apt-get -y --allow-change-held-packages install okapi=4.7.2-1    # R1-2021 Version
  # okapi.conf : Y or I : install the package maintainer's version
# okapi.conf zurückspielen:
  sudo cp -p /usr/folio/upgrade/okapi.conf /etc/folio/okapi/okapi.conf
  sudo apt-mark hold okapi
# Neustart Okapi:
  sudo systemctl daemon-reload
  sudo systemctl restart okapi.service
  # Nun das Log verfolgen ! Das läuft ein paar Minuten !
  # in /var/log/folio/okapi/okapi.log kommt
INFO DeploymentManager fast shutdown
# und direkt im Anschluss
INFO InternalModule InternalModule starting okapiversion=4.7.2
...
... Okpai startet die Module wieder an (das abwarten)
INFO MainVerticle Deploy completed succesfully

...


# Erstellen Sie die neueste Version der FOLIO Stripes-Plattform (Alfons & Ingolf)
  # Move to NodeJS LTS
  sudo n lts
  # installed : v14.17.0 (with npm 6.14.13)
  # Klone das Repositorium platform-complete, wechsle in das Verzeichnis
  # git clone https://github.com/folio-org/platform-complete
  cd /usr/folio/platform-complete
  git fetch
  # neuer Branch R1-2021, neuer Tag R1-2021-GA
  # Leihe den Zweig (s.u.) aus.
  # Lokale Änderungen zwischenspeichern. Das sollte nur stripes.config.js betreffen. Aber auch yarn.lock
  git add yarn.lock
  git stash save
  git checkout master
  git pull
  git checkout R1-2021
  git stash pop # das löscht auch den Zwischenspeicher
  # Installiere npm-Pakete
  sudo su
  yarn install
  # Done in 132.36s.
  vim ./stripes.config.js
  # => okapi: { 'url':./stripes.config.js
  # => okapi: { 'url':'https://folio-hbz1.hbz-nrw.de/okapi', 'tenant':'diku' },
  # Achtung ! Hier muss eine URL rein, die über https zugänglich ist, also für die es ein Zertifikat gibt, wenn man auch auf die index.html per https zugreift !
  # Ungesicherte URLs wie z.B. http://folio-hbz1.hbz-nrw.de:9130 gehen nicht, dann kommt in der JS Konsole: "Mixed Content: The page at 'https://folio-hbz1.hbz-nrw.de/okapi' was loaded over HTTPS, 'tenant':'diku' },
  # Achtung ! Hier muss eine URL rein, die über https zugänglich ist, also für die es ein Zertifikat gibt, wenn man auch auf die index.html per https zugreift !
  # Ungesicherte URLs wie z.B. http://folio-hbz1.hbz-nrw.de:9130 gehen nicht, dann kommt in der JS Konsole: "Mixed Content: The page at 'https://folio-hbz1.hbz-nrw.de/' was loaded over HTTPS, but requested an insecure resource 'http://folio-hbz1.hbz-nrw.de:9130/saml/check'. This request has been blocked; the content must be served over HTTPS."
  # in stripes.config.js kann man auch ein anderes Logo und Favoriten-Bildchen referenzieren (z.B. hbz- oder Kunden-Logo)

  # Dale 10.05.2021:
  Remove @folio/inventory-es from stripes.config.js

  NODE_ENV=production yarn build output   # dauert etwas
  # Done in 631.24s.but requested an insecure resource 'http://folio-hbz1.hbz-nrw.de:9130/saml/check'. This request has been blocked; the content must be served over HTTPS."
  # in stripes.config.js kann man auch ein anderes Logo und Favoriten-Bildchen referenzieren (z.B. hbz- oder Kunden-Logo)

  # Dale 10.05.2021:
  Remove @folio/inventory-es from stripes.config.js

  NODE_ENV=production yarn build output   # dauert etwas
  # Done in 631.24s.


# Bei dieser Gelegenheit: Aufräumen der Docker-Container
  # siehe hier https://linuxize.com/post/how-to-remove-docker-images-containers-volumes-and-networks/
  sudo su
  docker system prune
  # This will remove:
  #       - all stopped containers
  #       - all networks not used by at least one container
  #       - all dangling images
  #       - all build cache
  # Total reclaimed space: 673.1kB
  # Remove unused images:
  docker image prune -a
  # total reclaimed space: 3.004GB


  # Stellen Sie ein kompatibles FOLIO-Backend bereit und aktivieren Sie es für den Mandanten

...

  # IK: Zuerst Umgebungsvariablen für mod_pubsub ändern, wg. Kommunikation mit Kafka: siehe https://wiki.folio.org/pages/viewpage.action?pageId=65110747 ; KAFKA_HOST und OKAPI_URL auf aktuelle IP-Adresse setzen
  # Das auch für diese Module machen (in R1-2021 kommunzieren diese mit Kafka): Quelle: Checklist for Data-Import application setup on a new environment: Iris
  mod-data-import
  mod-source-record-manager
  mod-source-record-storage
  mod-inventory
  mod-inventory-storage
  * mod-inventory-storage       The module now depends on Kafka message broker. Kafka should be up and running before module install.   Inventory-storage APIs (instances/holding-records/items - create, update, delete actions) will fail with 500 status code if Kafka is unreachable.       Make sure KAFKA_PORT and KAFKA_HOST environment variables are set and propagated to the mod-inventory-storage container before module installation.
Bohdan Suprun Mikhail Fokanov Oleksii Petrenko:
The same approach as for mod-pubsub may be used here. We tried to follow the same naming for the properties.
  cd /usr/folio/upgrade
  # Modulversion für R1 2021: 2.0.7
  wget https://folio-registry.dev.folio.org/_/proxy/modules/mod-pubsub-2.0.7 -O pubsub-module-descriptor.json
  vim pubsub-module-descriptor.json
  # Im Launch-Deskriptor anpassen:
    }, {
      "name" : "KAFKA_HOST",
      "value" : "193.30.112.85"
    }, {
      "name" : "KAFKA_PORT",
      "value" : "9092"
    }, {
      "name" : "OKAPI_URL",
      "value" : "http://193.30.112.85:9130"
    }, {
      "name" : "SYSTEM_USER_PASSWORD",
      "value" : "****"    #  Hier irgendwas wählen (nicht das Standardpasswort verwenden, unsicher !)
    } ],
  curl -X DELETE -D - -w '\n' -H "$TOKEN" -H "X-Okapi-Tenant: $TENANT" http://localhost:9130/_/proxy/modules/mod-pubsub-2.0.7
  curl -i -w '\n' -X POST -H "$TOKEN" -H "X-Okapi-Tenant: $TENANT" -H 'Content-type: application/json' -d @pubsub-module-descriptor.json http://localhost:9130/_/proxy/modules

...

  # Entferne jetzt die 58 unbenutzten Container.
  # Erstelle eine Liste aller unbenutzen Module. Zunächst erstelle dazu eine Liste aller laufenden Container/Module:
  sudo docker ps --all > /usr/folio/upgrade/docker_ps.20210531.txttxt    # 119 Container

  # Alternativ kann man die Liste hieraus erstellen:

 # Gucken, was jetzt im Discovery ist:
  curl -w '\n' -D - -H "$TOKEN" -H "X-Okapi-Tenant: $TENANT" http://localhost:9130/_/discovery/modules     #  117 Module (Dieselben wie eben, außer Tierpfleger und Kafka)
  # schmeiße aus der neuen Liste alles raus, was benutzt wird
  cp docker_ps.20210531.txt modules_unused_in_R1-2021.txt
  # Schmeiße also alle Module raus, die in diesen Listen sind:
  curl -w '\n' -XGET -H "$TOKEN" -H "X-Okapi-Tenant: $TENANT" http://localhost:9130/_/proxy/tenants/supertenant/modules
  curl -w '\n' -XGET -H "$TOKEN" -H "X-Okapi-Tenant: $TENANT" http://localhost:9130/_/proxy/tenants/diku/modules
  # Över blifft (kann von Installation zu Installation variieren, je nachdem, wie viele "Altlasten" man mitgeschleppt hat):
  cat modules_unused_in_R1-2021.txt
mod-users-17.2.2
mod-audit-1.0.4
mod-codex-mux-2.9.2
mod-sender-1.4.0
mod-permissions-5.12.2
mod-finance-storage-5.0.2
mod-users-17.2.3
mod-data-export-3.0.4
mod-feesfines-15.9.2
mod-oai-pmh-3.2.4
mod-users-bl-6.1.1
mod-kb-ebsco-java-3.6.5
mod-login-saml-2.0.1
mod-orders-11.1.2
mod-login-7.1.1
mod-invoice-4.1.2
mod-licenses-3.0.1
mod-agreements-3.0.1
mod-finance-storage-6.0.1
mod-data-import-converter-storage-1.9.2
mod-template-engine-1.12.0
mod-courses-1.1.2
mod-patron-4.3.0
mod-finance-4.0.1
mod-courses-1.1.1
mod-organizations-storage-3.2.2
mod-erm-usage-3.0.2
mod-password-validator-1.8.2
mod-source-record-storage-4.1.3
mod-data-export-3.0.5
mod-inventory-16.1.3
mod-circulation-19.2.8
mod-orders-storage-11.1.4
mod-configuration-5.5.0
mod-notes-2.10.2
mod-user-import-3.3.0
mod-calendar-1.10.1
mod-erm-usage-harvester-2.0.2
mod-circulation-storage-12.1.4
mod-codex-inventory-1.8.0
mod-source-record-storage-4.1.4
mod-data-import-1.11.1
mod-codex-ekb-1.7.2
mod-tags-0.7.2
mod-organizations-1.1.1
mod-email-1.9.2
mod-notify-2.7.1
mod-invoice-storage-4.1.2
mod-event-config-1.6.1
mod-quick-marc-1.2.2
mod-source-record-manager-2.4.3
mod-ncip-1.6.3
mod-inventory-storage-19.4.4
mod-email-1.9.1
mod-patron-blocks-1.1.4
mod-authtoken-2.6.0
mod-gobi-1.11.1
mod-rtac-2.0.1
  # schicke DELETE an /discovery/modules, aber nur für die Module, die von keinem Mandanten mehr benutzt werden.
  curl -w '\n' -D - -X DELETE -H "$TOKEN" -H "X-Okapi-Tenant: $TENANT" http://localhost:9130/_/discovery/modules/<MODULE-ID>
  # z.B. curl -w '\n' -D - -X DELETE -H "$TOKEN" -H "X-Okapi-Tenant: $TENANT" http://localhost:9130/_/discovery/modules/mod-users-17.2.2
  ## wird jeweils mit "HTTP/1.1 204 No Content" quittiert.
  # Die DELETE-Befehle davor schreiben, dann die Datei ausführen:
  ./modules_unused_in_R1-2021.txt

...