Project

General

Profile

Actions

Feature #12518

open

Restore RRD and extra data from configuration backups when restoring during installation

Added by Viktor Gurov 3 months ago. Updated 15 days ago.

Status:
Feedback
Priority:
Normal
Assignee:
Category:
Installer
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
22.01
Release Notes:
Default

Description

Currently bsdinstall script simply removes any extra data or RRD data from the config.xml:
https://github.com/pfsense/FreeBSD-src/blob/devel-12/usr.sbin/bsdinstall/scripts/copy_configxml_from_usb#L67:

# Remove rrddata/xmldata if it is present, see https://redmine.pfsense.org/issues/11050
    REMOVE_DATA="rrddata captiveportaldata dhcpddata dhcpdv6data voucherdata sshdata" 
    for remdata in $REMOVE_DATA; do
        sed -i '' -e "/<$remdata>/,/<\/$remdata>/ d" ${recovery_dir}/config.xml
    done

it's better to keep this data, but add /cf/conf/config/bsdinstall_config_restore flag to run restore_backup() on boot

Actions #2

Updated by Jim Pingle about 2 months ago

  • Status changed from New to Pull Request Review
  • Assignee set to Viktor Gurov
  • Target version set to 2.6.0
  • Plus Target Version set to 22.01
Actions #3

Updated by Viktor Gurov about 2 months ago

  • Status changed from Pull Request Review to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by Jim Pingle about 2 months ago

  • Subject changed from Restore RRD and extra data on bsdinstall config.xml restore to Restore RRD and extra data from configuration backups when restoring during installation

Updating subject for release notes.

Actions #5

Updated by Viktor Gurov about 1 month ago

bsdinstaller does not create the '/cf/conf/trigger_restore_config_after_bsdinstall' file for some reason (https://github.com/pfsense/FreeBSD-src/blob/devel-12/usr.sbin/bsdinstall/scripts/copy_configxml_from_usb#L66)

if this file is created manually ("touch /cf/conf/trigger_restore_config_after_bsdinstall"), it will successfully restore extra data

Actions #7

Updated by Jim Pingle about 1 month ago

  • Status changed from Feedback to Pull Request Review
Actions #8

Updated by Jim Pingle 25 days ago

  • Status changed from Pull Request Review to Feedback

Already merged.

Actions #9

Updated by Jim Pingle 23 days ago

  • Status changed from Feedback to New

This can be activated unintentionally on upgrade the way it is now. It looks like the installer made /conf/installer_copied_config when it restored a config in the past, but that file was never removed when the system finished booting after installation. Because it wasn't removed, some systems may still have that file present even though they haven't been (re)installed in months or more. As a consequence, on upgrade this new code triggers and they get a notification about the restore. It should end up being a NOOP but the notification may still confuse users.

pfSense is restoring the configuration /tmp/config_to_restore.xml @ 2022-01-05 09:31:06

This should probably also look for some other indication that it's the first boot post install, such as the presence of {$g['conf_path']}/trigger_initial_wizard

Actions #11

Updated by Jim Pingle 18 days ago

  • Status changed from New to Pull Request Review
Actions #12

Updated by Viktor Gurov 15 days ago

  • Status changed from Pull Request Review to Feedback

Merged

Actions

Also available in: Atom PDF