From 520fd3e8c06e73b3fb515740c21149992380637b Mon Sep 17 00:00:00 2001 From: jo Date: Thu, 15 Sep 2022 15:53:52 +0200 Subject: [PATCH] docs: add tip to use yq for configuration upgrade --- docs/admin-manual/setup/configuration.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/admin-manual/setup/configuration.md b/docs/admin-manual/setup/configuration.md index cf82faf93..945e27336 100644 --- a/docs/admin-manual/setup/configuration.md +++ b/docs/admin-manual/setup/configuration.md @@ -11,6 +11,25 @@ Don't forget to restart the services after you made changes to the configuration sudo systemctl restart libretime.target ``` +:::tip + +When upgrading, if [`yq`](https://mikefarah.gitbook.io/yq/) is installed on your system, you can easily keep your configuration file schema in sync, without losing your configuration values: + +```bash +# Load your existing configuration values and merge them on top +# of the default configuration file +yq '. *= (load("/etc/libretime/config.yml") | ... comments="")' \ + installer/config.yml > update-config.yml + +# Check what has been updated +diff -y /etc/libretime/config.yml update-config.yml + +# Move the updated configuration file in place +sudo cp update-config.yml /etc/libretime/config.yml +``` + +::: + ## General The `general` section configure anything related to the legacy and API services.