From 3bf37c7de1b4af4cac642ed75d61bd157ec8901b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Mon, 14 Sep 2026 12:18:51 +0200 Subject: [PATCH 1/6] Add incremental backup procedures for containerized deployments Co-Authored-By: Claude Sonnet 4.5 --- .../common/assembly_backing-up-project.adoc | 5 ++- ...ssembly_restoring-project-from-backup.adoc | 2 +- .../proc_estimating-the-size-of-a-backup.adoc | 2 +- ...proc_performing-an-incremental-backup.adoc | 33 +++++++++++++++++++ ...oc_restoring-from-incremental-backups.adoc | 12 +++++++ .../modules/ref_available-backup-methods.adoc | 9 +++++ ...followed-by-daily-incremental-backups.adoc | 4 +-- 7 files changed, 60 insertions(+), 7 deletions(-) diff --git a/guides/common/assembly_backing-up-project.adoc b/guides/common/assembly_backing-up-project.adoc index ec1e676269e..965ce7ae971 100644 --- a/guides/common/assembly_backing-up-project.adoc +++ b/guides/common/assembly_backing-up-project.adoc @@ -18,16 +18,15 @@ ifdef::katello,orcharhino,satellite[] include::modules/proc_performing-an-offline-backup-without-pulp-content.adoc[leveloffset=+1] endif::[] -ifndef::containerized[] include::modules/proc_performing-an-incremental-backup.adoc[leveloffset=+1] -endif::[] ifdef::containerized[] include::modules/ref_example-of-a-weekly-full-backup.adoc[leveloffset=+1] endif::[] -ifndef::containerized[] + include::modules/ref_example-of-a-weekly-full-backup-followed-by-daily-incremental-backups.adoc[leveloffset=+1] +ifndef::containerized[] include::modules/proc_performing-an-online-backup.adoc[leveloffset=+1] include::modules/proc_creating-a-conventional-backup.adoc[leveloffset=+1] diff --git a/guides/common/assembly_restoring-project-from-backup.adoc b/guides/common/assembly_restoring-project-from-backup.adoc index 9a818273f18..3b43329b85f 100644 --- a/guides/common/assembly_restoring-project-from-backup.adoc +++ b/guides/common/assembly_restoring-project-from-backup.adoc @@ -2,8 +2,8 @@ include::modules/con_restoring-project-from-backup.adoc[] include::modules/proc_restoring-from-a-full-backup.adoc[leveloffset=+1] -ifndef::containerized[] include::modules/proc_restoring-from-incremental-backups.adoc[leveloffset=+1] +ifndef::containerized[] include::modules/proc_restoring-smart-proxy-server-by-using-a-virtual-machine-snapshot.adoc[leveloffset=+1] endif::[] diff --git a/guides/common/modules/proc_estimating-the-size-of-a-backup.adoc b/guides/common/modules/proc_estimating-the-size-of-a-backup.adoc index e2b308be020..b7cf975e370 100644 --- a/guides/common/modules/proc_estimating-the-size-of-a-backup.adoc +++ b/guides/common/modules/proc_estimating-the-size-of-a-backup.adoc @@ -35,7 +35,7 @@ ifdef::containerized[] [options="nowrap", subs="+quotes,attributes"] ---- # du -sh /var/lib/foremanctl -10MB /var/lib/pulp +10MB /var/lib/foremanctl ---- endif::[] ifndef::containerized[] diff --git a/guides/common/modules/proc_performing-an-incremental-backup.adoc b/guides/common/modules/proc_performing-an-incremental-backup.adoc index 41e4275e932..02e4fb31227 100644 --- a/guides/common/modules/proc_performing-an-incremental-backup.adoc +++ b/guides/common/modules/proc_performing-an-incremental-backup.adoc @@ -19,6 +19,7 @@ endif::[] .Procedure . Perform a full offline backup. For more information, see xref:performing-a-full-offline-backup[]. +ifndef::containerized[] . Create a directory within your backup directory to store the first incremental backup: + [options="nowrap", subs="+quotes,verbatim,attributes"] @@ -39,3 +40,35 @@ For example, if you want to make a new incremental backup from the full backup r ---- # {foreman-maintain} backup offline --incremental _/var/backup_directory/full_backup_ _/var/backup_directory_ ---- +endif::[] +ifdef::containerized[] +. Create the first incremental backup by specifying the full backup directory as the base: ++ +[options="nowrap", subs="+quotes,verbatim,attributes"] +---- +# {foremanctl} backup _/var/backup_ --base-backup _/var/backup/foreman-backup-YYYYMMDDTHHMMSS_ +---- ++ +This creates a new backup directory containing only files changed since the full backup. +. Create the second incremental backup by specifying the first incremental backup as the base: ++ +[options="nowrap", subs="+quotes,verbatim,attributes"] +---- +# {foremanctl} backup _/var/backup_ --base-backup _/var/backup/foreman-backup-YYYYMMDDTHHMMSS_ +---- ++ +This creates a directory for the second incremental backup in your backup directory. ++ +[NOTE] +==== +You can point to a different version of the backup, and make a series of increments with that version of the backup as the starting point. +For example, if you want to make a new incremental backup from the full backup rather than the first or second incremental backup, point to the full backup directory: + +[options="nowrap", subs="+quotes,verbatim,attributes"] +---- +# {foremanctl} backup _/var/backup_ --base-backup _/var/backup/foreman-backup-YYYYMMDDTHHMMSS_ +---- + +You can chain incremental backups, but all backups in the chain are required for restore. +==== +endif::[] diff --git a/guides/common/modules/proc_restoring-from-incremental-backups.adoc b/guides/common/modules/proc_restoring-from-incremental-backups.adoc index ba5ccf31d3a..b353b5ce7aa 100644 --- a/guides/common/modules/proc_restoring-from-incremental-backups.adoc +++ b/guides/common/modules/proc_restoring-from-incremental-backups.adoc @@ -20,11 +20,23 @@ endif::[] . Copy the incremental backup data to the local file system on {ProjectServer}, for example, `/var/` or `/var/tmp/`. . Restore the incremental backups in the same sequence that they are made: + +ifndef::containerized[] [options="nowrap", subs="+quotes,verbatim,attributes"] ---- # {foreman-maintain} restore _/var/backup_directory_/FIRST_INCREMENTAL # {foreman-maintain} restore _/var/backup_directory_/SECOND_INCREMENTAL ---- +endif::[] +ifdef::containerized[] +[options="nowrap", subs="+quotes,verbatim,attributes"] +---- +# {foremanctl} restore _/var/backup/foreman-backup-YYYYMMDDTHHMMSS_ --force +# {foremanctl} restore _/var/backup/foreman-backup-YYYYMMDDTHHMMSS_ --force +---- ++ +The `--force` flag is required for subsequent restores since the system is already deployed. +The restore process automatically detects incremental backups and validates the backup chain. +endif::[] .Next steps * If you create a new instance of {ProjectServer} or {SmartProxyServer}, decommission the old instance after restoring the backup. diff --git a/guides/common/modules/ref_available-backup-methods.adoc b/guides/common/modules/ref_available-backup-methods.adoc index d3b06ca34b7..e884af0f4c2 100644 --- a/guides/common/modules/ref_available-backup-methods.adoc +++ b/guides/common/modules/ref_available-backup-methods.adoc @@ -34,6 +34,15 @@ For more details, read help information for the offline backup: ---- endif::[] +Incremental backup:: +Incremental backups are offline backups that capture only files that have changed since a previous backup. +The require less time and storage than a full offline backup. +ifdef::containerized[] ++ +The backup process creates snapshot files that track changes, allowing you to chain incremental backups. +All backups in the chain are required for restore. +endif::[] + ifndef::containerized[] Online backup:: Only {Project} services that affect the consistency of the backup, including all background workers, are shut down while the backup process is running. diff --git a/guides/common/modules/ref_example-of-a-weekly-full-backup-followed-by-daily-incremental-backups.adoc b/guides/common/modules/ref_example-of-a-weekly-full-backup-followed-by-daily-incremental-backups.adoc index 4b71eb4e48a..a0cb561e06b 100644 --- a/guides/common/modules/ref_example-of-a-weekly-full-backup-followed-by-daily-incremental-backups.adoc +++ b/guides/common/modules/ref_example-of-a-weekly-full-backup-followed-by-daily-incremental-backups.adoc @@ -17,7 +17,8 @@ DESTINATION=/var/backup_directory if [[ $(date +%w) == 0 ]]; then {foremanctl} backup $DESTINATION else - {foremanctl} backup $DESTINATION + LAST=$(ls -td -- $DESTINATION/*/ | head -n 1) + {foremanctl} backup $DESTINATION --base-backup "$LAST" fi exit 0 ---- @@ -40,7 +41,6 @@ endif::[] ifdef::containerized[] Note that the `{foremanctl} backup` command requires `/sbin` and `/usr/sbin` directories to be in `PATH`. -Incremental backup is not available. endif::[] ifndef::containerized[] Note that the {``{foreman-maintain} backup``} command requires `/sbin` and `/usr/sbin` directories to be in `PATH` and the `--assumeyes` option is used to skip the confirmation prompt. From ef2a9901eeb939a492a5d3e49629ca94db09c3a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Mon, 14 Sep 2026 13:48:35 +0200 Subject: [PATCH 2/6] Make incremental backup commands clearer --- .../modules/proc_performing-an-incremental-backup.adoc | 6 +++--- .../modules/proc_restoring-from-incremental-backups.adoc | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/guides/common/modules/proc_performing-an-incremental-backup.adoc b/guides/common/modules/proc_performing-an-incremental-backup.adoc index 02e4fb31227..e67dfa6b15b 100644 --- a/guides/common/modules/proc_performing-an-incremental-backup.adoc +++ b/guides/common/modules/proc_performing-an-incremental-backup.adoc @@ -46,7 +46,7 @@ ifdef::containerized[] + [options="nowrap", subs="+quotes,verbatim,attributes"] ---- -# {foremanctl} backup _/var/backup_ --base-backup _/var/backup/foreman-backup-YYYYMMDDTHHMMSS_ +# {foremanctl} backup _/var/backup_ --base-backup _/var/backup/full_backup_ ---- + This creates a new backup directory containing only files changed since the full backup. @@ -54,7 +54,7 @@ This creates a new backup directory containing only files changed since the full + [options="nowrap", subs="+quotes,verbatim,attributes"] ---- -# {foremanctl} backup _/var/backup_ --base-backup _/var/backup/foreman-backup-YYYYMMDDTHHMMSS_ +# {foremanctl} backup _/var/backup_ --base-backup _/var/backup/first_incremental_backup_ ---- + This creates a directory for the second incremental backup in your backup directory. @@ -66,7 +66,7 @@ For example, if you want to make a new incremental backup from the full backup r [options="nowrap", subs="+quotes,verbatim,attributes"] ---- -# {foremanctl} backup _/var/backup_ --base-backup _/var/backup/foreman-backup-YYYYMMDDTHHMMSS_ +# {foremanctl} backup _/var/backup_ --base-backup _/var/backup/full_backup_ ---- You can chain incremental backups, but all backups in the chain are required for restore. diff --git a/guides/common/modules/proc_restoring-from-incremental-backups.adoc b/guides/common/modules/proc_restoring-from-incremental-backups.adoc index b353b5ce7aa..894af02a380 100644 --- a/guides/common/modules/proc_restoring-from-incremental-backups.adoc +++ b/guides/common/modules/proc_restoring-from-incremental-backups.adoc @@ -30,8 +30,8 @@ endif::[] ifdef::containerized[] [options="nowrap", subs="+quotes,verbatim,attributes"] ---- -# {foremanctl} restore _/var/backup/foreman-backup-YYYYMMDDTHHMMSS_ --force -# {foremanctl} restore _/var/backup/foreman-backup-YYYYMMDDTHHMMSS_ --force +# {foremanctl} restore _/var/backup/first_incremental_backup_ --force +# {foremanctl} restore _/var/backup/second_incremental_backup_ --force ---- + The `--force` flag is required for subsequent restores since the system is already deployed. From 9db7b01f8457fa2f5b10d8766b5beb832b99232c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20Petrov=C3=A1?= Date: Mon, 14 Sep 2026 13:48:51 +0200 Subject: [PATCH 3/6] Apply suggestion from @maximiliankolb Co-authored-by: Maximilian Kolb --- guides/common/modules/ref_available-backup-methods.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/common/modules/ref_available-backup-methods.adoc b/guides/common/modules/ref_available-backup-methods.adoc index e884af0f4c2..98db1e7d6b9 100644 --- a/guides/common/modules/ref_available-backup-methods.adoc +++ b/guides/common/modules/ref_available-backup-methods.adoc @@ -36,7 +36,7 @@ endif::[] Incremental backup:: Incremental backups are offline backups that capture only files that have changed since a previous backup. -The require less time and storage than a full offline backup. +They require less time and storage than a full offline backup. ifdef::containerized[] + The backup process creates snapshot files that track changes, allowing you to chain incremental backups. From 6a0d1c0e1388e3dfce13717c454bbd4c5efe9f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Tue, 15 Sep 2026 09:54:26 +0200 Subject: [PATCH 4/6] Drop an unnecessary (and wrong) line --- .../common/modules/proc_restoring-from-incremental-backups.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/guides/common/modules/proc_restoring-from-incremental-backups.adoc b/guides/common/modules/proc_restoring-from-incremental-backups.adoc index 894af02a380..f05218985f6 100644 --- a/guides/common/modules/proc_restoring-from-incremental-backups.adoc +++ b/guides/common/modules/proc_restoring-from-incremental-backups.adoc @@ -35,7 +35,6 @@ ifdef::containerized[] ---- + The `--force` flag is required for subsequent restores since the system is already deployed. -The restore process automatically detects incremental backups and validates the backup chain. endif::[] .Next steps From e2899cba09f0f9d7d922decdc41b16548d73c4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20=C5=A0teflov=C3=A1=20Petrov=C3=A1?= Date: Tue, 15 Sep 2026 11:31:53 +0200 Subject: [PATCH 5/6] Improve wording --- .../common/modules/proc_restoring-from-incremental-backups.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/common/modules/proc_restoring-from-incremental-backups.adoc b/guides/common/modules/proc_restoring-from-incremental-backups.adoc index f05218985f6..7bd672afa01 100644 --- a/guides/common/modules/proc_restoring-from-incremental-backups.adoc +++ b/guides/common/modules/proc_restoring-from-incremental-backups.adoc @@ -34,7 +34,7 @@ ifdef::containerized[] # {foremanctl} restore _/var/backup/second_incremental_backup_ --force ---- + -The `--force` flag is required for subsequent restores since the system is already deployed. +The `--force` flag is required for subsequent restores because the system is already deployed. endif::[] .Next steps From 1bd6a4abf0107f1c80985c9da5680d0cebf55701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aneta=20Petrov=C3=A1?= Date: Tue, 15 Sep 2026 20:14:00 +0200 Subject: [PATCH 6/6] Apply suggestion from tech review Co-authored-by: Chyenne8 --- .../modules/proc_restoring-from-incremental-backups.adoc | 7 ++++++- ...-full-backup-followed-by-daily-incremental-backups.adoc | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/guides/common/modules/proc_restoring-from-incremental-backups.adoc b/guides/common/modules/proc_restoring-from-incremental-backups.adoc index 7bd672afa01..c6ed8f7d3fa 100644 --- a/guides/common/modules/proc_restoring-from-incremental-backups.adoc +++ b/guides/common/modules/proc_restoring-from-incremental-backups.adoc @@ -15,9 +15,14 @@ ifndef::foreman-deb[] endif::[] .Procedure -. Restore the last full backup using the instructions in xref:Restoring_from_a_Full_Backup_{context}[]. +. Restore the last full backup by following the instructions in xref:Restoring_from_a_Full_Backup_{context}[]. +ifndef::containerized[] . Remove the full backup data from the local file system on {ProjectServer}, for example, `/var/` or `/var/tmp/`. . Copy the incremental backup data to the local file system on {ProjectServer}, for example, `/var/` or `/var/tmp/`. +endif::[] +ifdef::containerized[] +. Copy the incremental backup data to the local file system on {ProjectServer}. +endif::[] . Restore the incremental backups in the same sequence that they are made: + ifndef::containerized[] diff --git a/guides/common/modules/ref_example-of-a-weekly-full-backup-followed-by-daily-incremental-backups.adoc b/guides/common/modules/ref_example-of-a-weekly-full-backup-followed-by-daily-incremental-backups.adoc index a0cb561e06b..e76bd9ccef1 100644 --- a/guides/common/modules/ref_example-of-a-weekly-full-backup-followed-by-daily-incremental-backups.adoc +++ b/guides/common/modules/ref_example-of-a-weekly-full-backup-followed-by-daily-incremental-backups.adoc @@ -16,6 +16,11 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin DESTINATION=/var/backup_directory if [[ $(date +%w) == 0 ]]; then {foremanctl} backup $DESTINATION + ls -td -- $DESTINATION/*/ | head -n 1 > $DESTINATION/.last_full_backup + else + {foremanctl} backup $DESTINATION --base-backup "$(cat + $DESTINATION/.last_full_backup)" + fi else LAST=$(ls -td -- $DESTINATION/*/ | head -n 1) {foremanctl} backup $DESTINATION --base-backup "$LAST"