#2306 Issue closed: New backup software restic

Labels: enhancement, needs sponsorship, external tool, no-issue-activity

dcz01 opened issue at 2020-01-07 09:55:

Hello,
would it be possible, to implement this new backup software in ReaR?
https://restic.net/
https://github.com/restic/restic

Greetings
dcz01

schlomo commented at 2020-01-07 10:04:

Sure, why not? Please provide a PR with it and we will be happy to take a look at it.

From skimming the docs I would say that it should be fairly simple and straight forward to do.

jsmeix commented at 2020-01-13 14:16:

First things first ;-)
I think a GitHub pull request is basically the last step.

@dcz01
in general what you need for a new backup method
to get your backup restored during "rear recover"
is as a first step using only generic means in ReaR
to get the backup restore tool and all what it needs to run
(libraries, config files, whatever else) included in the
ReaR recovery system where "rear recover" is run,
cf. "Relax-and-Recover versus backup and restore" at
https://en.opensuse.org/SDB:Disaster_Recovery

The generic means in ReaR to get things included
in the ReaR recovery system are the config variables
COPY_AS_IS, REQUIRED_PROGS, and LIBS,
cf. usr/share/rear/conf/default.conf
or the current one online starting at
https://github.com/rear/rear/blob/master/usr/share/rear/conf/default.conf#L1286
see also "Testing current ReaR upstream GitHub master code" at
https://en.opensuse.org/SDB:Disaster_Recovery

So basically what you need in your etc/rear/local.conf are things like

REQUIRED_PROGS+=( /path/to/backup/restore/program /path/to/helper/program ... )
COPY_AS_IS+=( /path/to/backup/config/dir /path/to/other/needed/stuff ... )

plus perhaps if needed

LIBS+=( /path/to/libraries/that/are/not/automatically/found ... )

Because there is not yet any script in ReaR that would automatically
restore your backup during "rear recover" you also set in etc/rear/local.conf

BACKUP=REQUESTRESTORE

plus perhaps if needed an appropriate OUTPUT_URL=... setting
because with BACKUP=REQUESTRESTORE the OUTPUT_URL value
is not inherited from the BACKUP_URL value so you need to
specify the OUTPUT_URL value explicitly.

Then create the ReaR recovery system (without backup) with

rear -D mkrescue

and make your backup manually.

On your testing (replacement) hardware boot
this new ReaR recovery system and therein
run "rear -D recover" which should recreate the disk layout
and afterwards it stops in the script
usr/share/rear/restore/REQUESTRESTORE/default/200_prompt_user_to_start_restore.sh
https://github.com/rear/rear/blob/master/usr/share/rear/restore/REQUESTRESTORE/default/200_prompt_user_to_start_restore.sh
where you need to manually run the backup restore command
to get your backup restored into TARGET_FS_ROOT="/mnt/local".

After you had restored your backup into /mnt/local continue
the "rear -D recover" process to get the bootloader installed
and the other finalize stage things (e.g. recreate initrd, ...).

I assume you will need to do some trial and error steps
until you get it working for you with manual backup restore.

When that works you can as a next step try to automate that
with appropriate new config variables in default.conf like

COPY_AS_IS_RESTIC=( ... )
REQUIRED_PROGS_RESTIC=( ... )

and if needed

LIBS_RESTIC=( ... )
COPY_AS_IS_EXCLUDE_RESTIC=( ... )

plus new scripts in directories like

usr/share/rear/prep/RESTIC/default/
usr/share/rear/backup/RESTIC/default

usr/share/rear/verify/RESTIC/default
usr/share/rear/restore/RESTIC/default/

that automate making the backup during "rear mkbackup"
and restoring the backup during "rear recover".

See
https://github.com/rear/rear/blob/master/doc/user-guide/10-integrating-external-backup.adoc

gdha commented at 2020-02-28 12:53:

@dcz01 To who was the question raised? To the community or to the core developers? I think the core developers have their hands full with supporting ReaR and updating it to a quality level that is required for these days Operating Systems.
You can always try to do the first integration tests (with following PRs which we can examine), or ask for sponsoring by others?

github-actions commented at 2020-08-24 01:34:

Stale issue message


[Export of Github issue for rear/rear.]