Kubrik OSSUPPORTSOPORTE All productsTodos los productos
Technical manualManual técnico › Operation › Protecting the data › Upgrading to a new versionOperación › Cuidar los datos › Actualizar a una versión nueva

Upgrading to a new version

Actualizar a una versión nueva

A new version is a new pair of images. When the new application starts, it changes the database by itself to the form that version needs. This chapter gives the safe order and explains what those changes do.

Una versión nueva es un par nuevo de imágenes. Cuando la aplicación nueva arranca, cambia sola la base de datos a la forma que esa versión necesita. Este capítulo da el orden seguro y explica qué hacen esos cambios.

👤 Who: System administrator📍 Where: Server console
👤 Quién: Administrador de sistemas📍 Dónde: Consola del servidor

What the migrations do

Qué hacen las migraciones

Each version of the application carries a numbered list of changes to the database, called migrations. At every start-up, before answering anything, the application:

Cada versión de la aplicación trae una lista numerada de cambios a la base de datos, llamados migraciones. En cada arranque, antes de contestar nada, la aplicación:

  1. Compares the migrations it carries with the ones the database has already applied. Each applied migration is remembered with a fingerprint of its content.
  2. Checks that none of the applied ones has changed.
  3. Applies, in order, the ones the database does not have yet.
  4. Starts answering only when all of that ended well.
  1. Compara las migraciones que trae con las que la base ya tiene aplicadas. Cada migración aplicada queda recordada con una huella de su contenido.
  2. Controla que ninguna de las aplicadas haya cambiado.
  3. Aplica, en orden, las que la base todavía no tiene.
  4. Empieza a contestar recién cuando todo eso terminó bien.
⛔
A migration that fails stops the start-up. The application does not run with a half-updated database: the container stops, the log says which migration failed and why, and the system stays down until it is solved. That is why you make a copy first.Una migración que falla detiene el arranque. La aplicación no corre con una base a medio actualizar: el contenedor se detiene, el registro dice qué migración falló y por qué, y el sistema queda caído hasta resolverlo. Por eso primero hacés una copia.

Upgrade, step by step

Actualizar, paso a paso

  1. Choose a quiet moment and tell the users. The system is down from the moment you stop the old application until the new one finishes starting.
  2. Make the three copies: database, file store and configuration. See Backups and restore.
  3. Get the source tree of the new version and build the two images of your edition, as in Requirements and images. The images keep the same names, so the new ones replace the old.
  4. Compare the Compose file and the list of variables of the new version with yours, and carry over any new required setting. See the Configuration reference.
  5. Recreate the services. docker compose -f docker-compose.<edition>.yml up -d
  6. Follow the start-up with docker compose -f docker-compose.<edition>.yml logs -f backend until the box with Edition initialized appears.
  7. Check curl http://localhost:8222/actuator/info for the new version, sign in and try one task of each module you use.
  1. Elegí un momento tranquilo y avisá a los usuarios. El sistema queda caído desde que detenés la aplicación vieja hasta que la nueva termina de arrancar.
  2. Hacé las tres copias: base de datos, almacén de archivos y configuración. Mirá Copias de seguridad y restauración.
  3. Conseguí el código fuente de la versión nueva y construí las dos imágenes de tu edición, como en Requisitos e imágenes. Las imágenes conservan los mismos nombres, así que las nuevas reemplazan a las viejas.
  4. Compará el archivo Compose y la lista de variables de la versión nueva con los tuyos, y pasá cualquier ajuste obligatorio nuevo. Mirá la Referencia de configuración.
  5. Recreá los servicios. docker compose -f docker-compose.<edición>.yml up -d
  6. Seguí el arranque con docker compose -f docker-compose.<edición>.yml logs -f backend hasta que aparezca el recuadro con Edition initialized.
  7. Revisá curl http://localhost:8222/actuator/info para ver la versión nueva, ingresá y probá una tarea de cada módulo que uses.
ℹ️
Users who had the administration app open keep the old screens until they reload the page. Ask them to reload after an upgrade.Los usuarios que tenían abierta la aplicación de administración siguen con las pantallas viejas hasta que recargan la página. Pediles que recarguen después de una actualización.
⚠️
Upgrade both images together. A new application with an old administration app, or the other way round, shows screens that do not match what the application answers.Actualizá las dos imágenes juntas. Una aplicación nueva con una aplicación de administración vieja, o al revés, muestra pantallas que no coinciden con lo que contesta la aplicación.

If the upgrade fails

Si la actualización falla

  1. Read the reason at the end of the log of backend. Keep that text.
  2. Do not touch the database by hand and do not start the previous version on it.
  3. Go back: restore the database copy, put the previous images and configuration back and start. See Backups and restore.
  4. Send the saved text to Kubrik support before trying again.
  1. Leé el motivo al final del registro de backend. Guardá ese texto.
  2. No toques la base a mano ni arranques sobre ella la versión anterior.
  3. Volvé atrás: restaurá la copia de la base, volvé a poner las imágenes y la configuración anteriores y arrancá. Mirá Copias de seguridad y restauración.
  4. Mandale el texto guardado al soporte de Kubrik antes de intentar de nuevo.
💡
Before building the new images, keep the old ones under another name, for example docker tag kubrik-erp-be:professional kubrik-erp-be:previous and the same for kubrik-erp-fe. Going back is then a matter of minutes.Antes de construir las imágenes nuevas, guardá las viejas con otro nombre, por ejemplo docker tag kubrik-erp-be:professional kubrik-erp-be:previous y lo mismo para kubrik-erp-fe. Así volver atrás es cuestión de minutos.

Common issues

Problemas habituales

"Migration checksum mismatch for migration version …"
A migration that the database already applied is different in this image. Either the images were built from a modified source tree, or they belong to another line of versions. Do not repair it by hand: go back to the previous images and contact Kubrik support with the number in the message.
The log names a migration and a database error, and the container stops
That migration could not be applied to your data. Go back as described above and send the text to Kubrik support.
The start-up takes much longer than usual
A version with many migrations, or one that rewrites a large table, takes longer the first time. Follow the log: while new lines appear, it is working.
After the upgrade the container stops with a message about a missing variable
The new version asks for a setting that yours does not have. The message names it; add it and start again. The database is not affected.
«Migration checksum mismatch for migration version …»
Una migración que la base ya tiene aplicada es distinta en esta imagen. O las imágenes se construyeron desde un código modificado, o son de otra línea de versiones. No lo repares a mano: volvé a las imágenes anteriores y contactá al soporte de Kubrik con el número del mensaje.
El registro nombra una migración y un error de base de datos, y el contenedor se detiene
Esa migración no se pudo aplicar a tus datos. Volvé atrás como se describe arriba y mandale el texto al soporte de Kubrik.
El arranque tarda mucho más que de costumbre
Una versión con muchas migraciones, o una que reescribe una tabla grande, tarda más la primera vez. Seguí el registro: mientras aparezcan líneas nuevas, está trabajando.
Después de actualizar, el contenedor se detiene con un mensaje sobre una variable que falta
La versión nueva pide un ajuste que el tuyo no tiene. El mensaje la nombra; agregala y arrancá de nuevo. La base no se ve afectada.

RelatedRelacionado