Skip to content

debian: dbconfig allow major upgrade without backup dump#2506

Merged
BareosBot merged 3 commits intobareos:masterfrom
bruno-at-bareos:dbconfig-no-backup-with-upgrade
Feb 13, 2026
Merged

debian: dbconfig allow major upgrade without backup dump#2506
BareosBot merged 3 commits intobareos:masterfrom
bruno-at-bareos:dbconfig-no-backup-with-upgrade

Conversation

@bruno-at-bareos
Copy link
Contributor

@bruno-at-bareos bruno-at-bareos commented Jan 14, 2026

doc: cleanup CatalogMaintenance

  • Remove reference to UCS, as Bareos no longer provides specific packages for UCS.
  • Remove the hint about dpkg-reconfigure bareos-database-common, as at least with current versions of dbconfig-common (2.0.25), it only allows to reinstall the database, and not to change its configuration.
  • Show matching debconf settings.
  • Added instruction how to show default values.
  • Add low level export for dbconfig

dbconfig: apply our defaults on initial installation

  • New defaults (no upgrade backup, socket connection, ident)

Fix https://github.com/bareos/internal/issues/207

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Required backport PRs have been created
  • Correct milestone is set
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR

@bruno-at-bareos bruno-at-bareos self-assigned this Jan 15, 2026
@bruno-at-bareos bruno-at-bareos force-pushed the dbconfig-no-backup-with-upgrade branch 2 times, most recently from 7ea9598 to 7b45ed3 Compare January 19, 2026 14:10
@bruno-at-bareos bruno-at-bareos marked this pull request as draft January 19, 2026 15:40
@bruno-at-bareos
Copy link
Contributor Author

@bruno-at-bareos
Copy link
Contributor Author

Prepare documentation update for a warning

@bruno-at-bareos bruno-at-bareos force-pushed the dbconfig-no-backup-with-upgrade branch from 7b45ed3 to a8ba4ff Compare January 29, 2026 15:07
@bruno-at-bareos bruno-at-bareos marked this pull request as ready for review January 29, 2026 15:25
@bruno-at-bareos
Copy link
Contributor Author

To quickly test with the help of our containers and your personal subscription login

using podman run registry.bareos.com/debian-13-x86_64-repotest

apt update -y && apt upgrade -y && apt install -y curl
cp ~/bareos/.netrc ~/.netrc
alias ll='ls -lah'
chmod 0600 ~/.netrc
curl -L -n -O https://download.bareos.com/bareos/release/24/Debian_13/add_bareos_repositories.sh
bash add_bareos_repositories.sh
apt update -y
apt install -y bareos
sed -i '/dbaddress/d' /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf
systemctl enable --now bareos-director bareos-storage bareos-filedaemon
bconsole <<< "run job=backup-bareos-fd yes
wait
m
"
apt install iproute2 -y
bconsole <<< "run job=backup-bareos-fd yes
wait
m
"

debconf-show bareos-database-common

echo "bareos-database-common	bareos-database-common/upgrade-backup	boolean	false" | debconf-set-selections -v

# export dbc_debug=yes

curl -L -n -O https://download.bareos.org/next/Debian_13/add_bareos_repositories.sh
bash add_bareos_repositories.sh
apt update -y
apt upgrade -y

@bruno-at-bareos bruno-at-bareos changed the title debian: dbconfig unset dbc_config_allow_backup to avoid db dumps during package upgrade doc: debian dbconfig allow major upgrade without backup dump Jan 29, 2026
@bruno-at-bareos
Copy link
Contributor Author

@arogge being one of the issue finder, would the proposed instructions full-fill your requirements ?

@joergsteffens
Copy link
Member

@bruno-at-bareos not all of the settings in debconf-show are in the way, we want them to be (password instead of ident, TCP instead of socket). I did some tests with debconf and I think we can safely modify the settings at least on initial installations. How about adding the commit from #2532 to this PR?

@joergsteffens
Copy link
Member

I'm not sure if an additional hint in the doc about how to get asked all the debconf questions is helpful. It would something like:

DEBIAN_PRIORITY=low apt install bareos-database-common

or

export DEBIAN_PRIORITY=low

and then continue with the normal installation. However, this isn't Bareos specific, but a common Debian mechanism.

@bruno-at-bareos
Copy link
Contributor Author

@bruno-at-bareos not all of the settings in debconf-show are in the way, we want them to be (password instead of ident, TCP instead of socket). I did some tests with debconf and I think we can safely modify the settings at least on initial installations. How about adding the commit from #2532 to this PR?

Absolutely, that would help anyone starting a new server to have sane defaults.
I'll go to cherry pick them and add them here.

@bruno-at-bareos
Copy link
Contributor Author

I'm not sure if an additional hint in the doc about how to get asked all the debconf questions is helpful. It would something like:

DEBIAN_PRIORITY=low apt install bareos-database-common

or

export DEBIAN_PRIORITY=low

and then continue with the normal installation. However, this isn't Bareos specific, but a common Debian mechanism.

Even if it is a "common" debian things, finding that specific parameter is not easy as it should, and as it bring lot of confort for a Bareos beginner, I would like to see it in doc.

I'm doing the additional changes. Thanks for the suggestion.

joergsteffens
joergsteffens previously approved these changes Feb 5, 2026
Copy link
Member

@joergsteffens joergsteffens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joergsteffens
Copy link
Member

I added some more changes. Feel free, to squash them.

  • I thought again about it, and setting the default (if the user have not specified it otherwise) "bareos-database-common/upgrade-backup" "false" seams save to me. So the package will do this on installation as well as on update.
  • fixed/improved the output of debconf-show
  • removed outdated info from the documentation

TODOS:

  • "doc" should be removed from the title
  • squash commits?
  • build matrix
  • maybe the newly introduced warning about manually setting bareos-database-common/upgrade-backup is no longer required?

@bruno-at-bareos bruno-at-bareos changed the title doc: debian dbconfig allow major upgrade without backup dump debian: dbconfig allow major upgrade without backup dump Feb 9, 2026
@bruno-at-bareos bruno-at-bareos removed the documentation This PR changes only documentation label Feb 9, 2026
@bruno-at-bareos bruno-at-bareos force-pushed the dbconfig-no-backup-with-upgrade branch 2 times, most recently from 93162b0 to a90b161 Compare February 9, 2026 09:32
@bruno-at-bareos
Copy link
Contributor Author

@joergsteffens I've done the rename of the title of the pr (might still be changed to also dbconfig: apply our defaults on initial installation like pr 2552 ?)
I've done the squashing, the removal of the warning.

Waiting final build to check binaries. Thanks a lot for the suggestions and the new defaults.

@bruno-at-bareos bruno-at-bareos dismissed joergsteffens’s stale review February 9, 2026 12:44

With last changes we still needs adaptation to make it work.

@joergsteffens
Copy link
Member

I tried to reproduce that, but on my Debian 13 test environment it runs as expected.

Also:

cat bareos-database-common-24.debconf 
  bareos-database-common/app-password-confirm: (password omitted)
* bareos-database-common/database-type: pgsql
  bareos-database-common/db/app-user: bareos@localhost
* bareos-database-common/dbconfig-install: true
  bareos-database-common/dbconfig-reinstall: false
  bareos-database-common/dbconfig-remove: true
  bareos-database-common/dbconfig-upgrade: true
  bareos-database-common/db/dbname: bareos
  bareos-database-common/install-error: abort
  bareos-database-common/internal/reconfiguring: false
  bareos-database-common/internal/skip-preseed: false
  bareos-database-common/missing-db-package-error: abort
  bareos-database-common/password-confirm: (password omitted)
  bareos-database-common/passwords-do-not-match:
  bareos-database-common/pgsql/admin-pass: (password omitted)
  bareos-database-common/pgsql/admin-user: postgres
  bareos-database-common/pgsql/app-pass: (password omitted)
  bareos-database-common/pgsql/authmethod-admin: ident
  bareos-database-common/pgsql/authmethod-user: password
  bareos-database-common/pgsql/changeconf: false
  bareos-database-common/pgsql/manualconf:
  bareos-database-common/pgsql/method: TCP/IP
  bareos-database-common/pgsql/no-empty-passwords:
  bareos-database-common/purge: false
* bareos-database-common/remote/host: localhost
  bareos-database-common/remote/newhost: localhost
  bareos-database-common/remote/port:
  bareos-database-common/remove-error: abort
  bareos-database-common/upgrade-backup: true
  bareos-database-common/upgrade-error: abort

after:

cat bareos-database-common-26.debconf 
  bareos-database-common/app-password-confirm: (password omitted)
* bareos-database-common/database-type: pgsql
  bareos-database-common/db/app-user: bareos@localhost
* bareos-database-common/dbconfig-install: true
  bareos-database-common/dbconfig-reinstall: false
  bareos-database-common/dbconfig-remove: true
* bareos-database-common/dbconfig-upgrade: true
  bareos-database-common/db/dbname: bareos
  bareos-database-common/install-error: abort
  bareos-database-common/internal/reconfiguring: false
  bareos-database-common/internal/skip-preseed: false
  bareos-database-common/missing-db-package-error: abort
  bareos-database-common/password-confirm: (password omitted)
  bareos-database-common/passwords-do-not-match:
  bareos-database-common/pgsql/admin-pass: (password omitted)
  bareos-database-common/pgsql/admin-user: postgres
  bareos-database-common/pgsql/app-pass: (password omitted)
  bareos-database-common/pgsql/authmethod-admin: ident
  bareos-database-common/pgsql/authmethod-user: password
  bareos-database-common/pgsql/changeconf: false
  bareos-database-common/pgsql/manualconf:
  bareos-database-common/pgsql/method: TCP/IP
  bareos-database-common/pgsql/no-empty-passwords:
  bareos-database-common/purge: false
* bareos-database-common/remote/host: localhost
  bareos-database-common/remote/newhost: localhost
  bareos-database-common/remote/port:
  bareos-database-common/remove-error: abort
  bareos-database-common/upgrade-backup: false
  bareos-database-common/upgrade-error: abort

Could you verify, that your test environment is correct?
Also: I'm missing the * in your output (and the piping through sort). * means "seen": question has been shown to and answered by the user. If in your environment bareos-database-common/upgrade-backup is marked as seen (because of previous testing) this would explain the different behavior, as I only modify values automatically, if it is not flagged as seen.

@bruno-at-bareos
Copy link
Contributor Author

@joergsteffens after using the right PR binaries, all tests conclude to a correct upgrade path, where 26 doesn't do anymore dump before upgrade and settings correctly set

  bareos-database-common/app-password-confirm: (password omitted)
  bareos-database-common/database-type: pgsql
  bareos-database-common/db/app-user: bareos@localhost
  bareos-database-common/db/dbname: bareos
  bareos-database-common/dbconfig-install: true
  bareos-database-common/dbconfig-reinstall: false
  bareos-database-common/dbconfig-remove: true
  bareos-database-common/dbconfig-upgrade: true
  bareos-database-common/install-error: abort
  bareos-database-common/internal/reconfiguring: false
  bareos-database-common/internal/skip-preseed: false
  bareos-database-common/missing-db-package-error: abort
  bareos-database-common/password-confirm: (password omitted)
  bareos-database-common/passwords-do-not-match:
  bareos-database-common/pgsql/admin-pass: (password omitted)
  bareos-database-common/pgsql/admin-user: postgres
  bareos-database-common/pgsql/app-pass: (password omitted)
  bareos-database-common/pgsql/authmethod-admin: ident
  bareos-database-common/pgsql/authmethod-user: password
  bareos-database-common/pgsql/changeconf: false
  bareos-database-common/pgsql/manualconf:
  bareos-database-common/pgsql/method: TCP/IP
  bareos-database-common/pgsql/no-empty-passwords:
  bareos-database-common/purge: false
  bareos-database-common/remote/host: localhost
  bareos-database-common/remote/newhost: localhost
  bareos-database-common/remote/port:
  bareos-database-common/remove-error: abort
  bareos-database-common/upgrade-backup: false
  bareos-database-common/upgrade-error: abort

So we are green for a merge.
I will prepare a backport for 25.

@bruno-at-bareos bruno-at-bareos added this to the 26.0.0 milestone Feb 13, 2026
joergsteffens and others added 3 commits February 13, 2026 16:53
- Remove reference to UCS, as Bareos no longer provides specific
  packages for UCS.
- Remove the hint about dpkg-reconfigure bareos-database-common, as
  at least with current versions of dbconfig-common (2.0.25), it only
  allows to reinstall the database, and not to change its
  configuration.
- Show matching debconf settings.
- Added instruction how to show default values.
- Add low level export for dbconfig

Fix bareos/internal#207

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
@BareosBot BareosBot force-pushed the dbconfig-no-backup-with-upgrade branch from 56cb17c to 2431b89 Compare February 13, 2026 16:53
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

These changes implement Debian dbconfig major upgrade support without backup dumps, adding configuration helper functions for database method selection and migration handling, fixing argument quoting in the Bareos database package installer, and updating documentation to reflect Debian/Ubuntu-only support.

Changes

Cohort / File(s) Summary
Debian Package Configuration
debian/bareos-database-common.config.in, debian/bareos-database-common.postinst.in
Added helper functions bareos_db_set_default() and bareos_db_compare() for configuration management. Extended config.in to set initial defaults (Unix socket method, ident auth, no upgrade backup) and handle upgrade migration flow. Fixed argument quoting in postinst for proper space preservation.
Documentation Updates
docs/manuals/source/TasksAndConcepts/CatalogMaintenance.rst, CHANGELOG.md
Removed UCS platform references, narrowed support documentation to Debian and Ubuntu. Removed dpkg-reconfigure guidance from dbconfig-common section. Added changelog entry for Debian dbconfig major upgrade feature.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops through config files with glee,
Setting defaults and comparing with key-values so free,
No backup dumps needed for upgrades divine,
Just Unix sockets and ident to align,
Debian and Ubuntu now perfectly fine! 🎉

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@BareosBot BareosBot merged commit 63a260b into bareos:master Feb 13, 2026
@bruno-at-bareos bruno-at-bareos deleted the dbconfig-no-backup-with-upgrade branch March 4, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants