How-To: Reinstalling an app while cleaning (unsetting) its UCR variables

Introduction

Occasionally, you might want to reinstall an app from scratch, clearing all its UCR variables for a clean installation. This quick guide helps you back up UCR variables before unsetting them and reinstalling the app.

Let’s assume you want to reinstall the app Keycloak and start anew.

Steps

  • 1. Uninstall the app:
    univention-app remove keycloak

  • 2. Find the corresponding UCR variables:
    ucr search --brief keycloak

  • 3. You might see some variables that you should keep anyway, like appcenter/apps/keycloak/...
    So we have to fine-tune our search parameters. In this example the following would be sufficient (notice the ^):
    ucr search --brief ^keycloak

  • 4. IMPORTANT: Please create a backup for the UCR variables:
    ucr search --brief ^keycloak > backup.txt

  • 5. Now that we made sure those variables can be unset, we strip out the values with sed and sort and save the result in a variable:
    x=$(ucr search --brief ^keycloak | sed -e 's|: .*||p' | sort -u)

  • 6. Unset the variables we saved in x :
    ucr unset $x

  • 7. Reinstall the app
    univention-app install keycloak

1 Like

This topic was automatically closed after 24 hours. New replies are no longer allowed.

Mastodon