Bug 54959 - Backup and restore UCR DB on Kelvin updates
Summary: Backup and restore UCR DB on Kelvin updates
Status: CLOSED FIXED
Alias: None
Product: UCS@school
Classification: Unclassified
Component: HTTP-API (Kelvin)
Version: UCS@school 5.0
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: Tobias Wenzel
QA Contact: Felix Botner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-07 12:24 CEST by Felix Botner
Modified: 2023-05-26 10:57 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID:
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2022-07-07 12:24:41 CEST
In the id broker setup we set "ucr set ucsschool/username/max_length=50" in the KELVIN container.

Now if there is an update for the KELVIN app this setting is lost in the new container (base.conf is not copied during app upgrade).


We should add an app setting for ucsschool/username/max_length.
Comment 1 Daniel Tröder univentionstaff 2022-07-07 16:45:08 CEST
At customers that use the UCS@school import, that setting should be kept equal in both the host and in Kelvin.
Another use case for the Distributed Configuration DB.
Comment 2 Daniel Tröder univentionstaff 2022-09-02 12:18:59 CEST
As an intermediate step, backup the base.conf before app updates and restore it afterwards.

Appcenter documentation: https://wiki.univention.de/index.php?title=Docker_Apps/Image_Based&oldid=13408#Upgrading_an_image_based_Docker_App
Comment 4 Tobias Wenzel univentionstaff 2022-09-27 12:41:39 CEST

What I learned:

- To actually run the appcenter scripts, We have to adjust https://appcenter-test.software-univention.de/meta-inf/4.4/ucsschool-kelvin-rest-api/ucsschool-kelvin-rest-api_20220706163242.ini 

 DockerScriptRestoreDataAfterSetup = /usr/share/univention-docker-container-mode/restore_data_after_setup_custom
 DockerScriptStoreData = /usr/share/univention-docker-container-mode/store_data_custom

or set it in the Provider Portal (which is what I did). 
- As far as I understood, the button to enable this is greyed out for released versions. We can of course upload the ini file. This seems a little bit messy which is the reason I chose not to do it. Instead I added a paragraph to the readme update, which will do essentially the same as the `store_script`. The restore will then happen automatically. If you (QA) thinks we should do it, we can change it of course :smile: 

How did I test this?

Before fix

univention-app install ucsschool-kelvin-rest-api=1.6.0
univention-app shell ucsschool-kelvin-rest-api sh -c "ucr set test=value"
univention-app upgrade ucsschool-kelvin-rest-api # -> 1.7.0

-> test-ucr value not set


After fix

univention-app install ucsschool-kelvin-rest-api=1.6.0
univention-app shell ucsschool-kelvin-rest-api sh -c "ucr set test=value"
univention-app upgrade ucsschool-kelvin-rest-api # -> 1.7.0

-> test-ucr value set


This has already been qa't + the changes for 1.5.6 + 1.6.0 have been updated to the production app center. 

The release for 1.7.0 will be - well - part of 1.7.0.
Comment 5 Felix Botner univentionstaff 2022-09-27 12:55:17 CEST
OK - 1.5.6 modified and released
OK - 1.6.0 modified and released
OK - 1.7.0 modified
Comment 6 Tobias Wenzel univentionstaff 2022-10-26 16:17:45 CEST
Released with UCS@school Kelvin REST API 1.7.0.