Upgrading to 2.4.4_3 and failed and I am stuck!
-
@dragoangel Thanks for the rapid response. How does back up the config.xml file if the only connection I have is via the console cable?
-
@kcallis :
- What hardware/hypervisor you run?
- If this hardware: you can put-in and mount preformed flash-drive and use cp to copy file
- If this VM you can simply use "Snapshot" and try to reinstall without copying file: on full reinstall of OS - installation wizard will give you option to recover from config of previous install. This little bit risky: if you will format drive and not finish install you will loose your config.xml. But with Snapshot you can simply go back.
- If you was enabled Auto Config Backups and know your "Device Key" and "Encryption Key" then you not need to worry - you can restore from cloud backups.
-
@dragoangel said in Upgrading to 2.4.4_3 and failed and I am stuck!:
@kcallis :
- What hardware/hypervisor you run?
- If this hardware: you can put-in and mount preformed flash-drive and use cp to copy file
- If this VM you can simply use "Snapshot" and try to reinstall without copying file: on full reinstall of OS - installation wizard will give you option to recover from config of previous install. This little bit risky: if you will format drive and not finish install you will loose your config.xml. But with Snapshot you can simply go back.
- If you was enabled Auto Config Backups and know your "Device Key" and "Encryption Key" then you not need to worry - you can restore from cloud backups.
I am using the Netgate APU, probably the last unit before the new devices. So one console port, one USB port (duh, I forgot the I have a USB port) and three interfaces (WAN, LAN, OPT).
-
If you have SSH enabled you may also use SCP or WinSCP to download the config via network.
-
@viragomann he can if LAN connectivity or SSHD daemon not broken too...
-
Looking at the Backup and Recovery, I installed a boot thumb drive in the first USB port and a vfat formatted thumb drive in the second. I then tried to recover the config.xml, but nothing was written to the data thrumb drive. What did I miss? I am not a FreeBSD person, so I am not sure how to mount the data drive so I can copy the file. And do I need to create a config directory on the data drive or can I just name it config.xml and do I need to convert if from dos2unix? I do now that the file is in place in the /tmp/recoved_config/config.xml.
-
If you can still boot to current OS: first backup your CONFIG.XML. For this you need not boot from Installation Flash-Drive - remove it.
https://docs.netgate.com/pfsense/en/latest/backup/automatically-restore-during-install.html
https://docs.netgate.com/pfsense/en/latest/solutions/apu/reinstall-pfsense.html
In future better begin to backup configs before updates, or use Cloud Backups or use separated Linux machine to take backups remotely by bash script with crontab:#!/bin/bash # [Editable] Source pfSense IP Address PFSENSE_URL=https://pfsense:port # [Editable] pfSense User (create user with allowed backups page only permissions) PF_USER=backup # [Editable] pfSense Password PF_PASSWORD=password # [Editable] ZIP Password ZIP_PASSWORD=zip-password # [Editable] Destination backups folder: PFSENSE_BACKUP_ROOT=/mnt/some_storage # [Editable] Temprorary folder for rsync files: TEMP_FOLDER=/tmp/pfsense_backup # [Static] Common envirement: DATE=$(date +"%Y%m%d") TIME=$(date +%Y.%m.%d' '%H:%M:%S) PFSENSE_CONFIG=$DATE-config.zip # # Begin backup job ################################################# mkdir -p $PFSENSE_BACKUP_ROOT mkdir -p $TEMP_FOLDER rm -rf $TEMP_FOLDER/* chown -R $(whoami):$(whoami) $TEMP_FOLDER chmod -R 750 $TEMP_FOLDER cd $TEMP_FOLDER # # Use WGET to get backups, documented in https://doc.pfsense.org/index.php/Remote_Config_Backup ################################################## # Fetch the login form and save the cookies and CSRF token echo $TIME Starting backup... wget -qO- --keep-session-cookies --save-cookies cookies.txt --no-check-certificate $PFSENSE_URL/diag_backup.php | grep "name='__csrf_magic'" | sed 's/.*value="\(.*\)".*/\1/' > csrf.txt # Submit the login form along with the first CSRF token and save the second CSRF token (can't reuse the same file) -- now the script is logged in and can take action. wget -qO- --keep-session-cookies --load-cookies cookies.txt --save-cookies cookies.txt --no-check-certificate --post-data "login=Login&usernamefld=$PF_USER&passwordfld=$PF_PASSWORD&__csrf_magic=$(cat csrf.txt)" $PFSENSE_URL/diag_backup.php | grep "name='__csrf_magic'" | sed 's/.*value="\(.*\)".*/\1/' > csrf2.txt # Submit the download form along with the second CSRF token to save a copy of config.xml wget --keep-session-cookies --load-cookies cookies.txt --no-check-certificate --post-data "download=download&donotbackuprrd=yes&__csrf_magic=$(head -n 1 csrf2.txt)" $PFSENSE_URL/diag_backup.php -O config.xml zip -P $ZIP_PASSWORD $PFSENSE_BACKUP_ROOT/$PFSENSE_CONFIG config.xml rm -rf $TEMP_FOLDER # Delete backups older then 14 days. find $PFSENSE_BACKUP_ROOT -type f -mtime +14 -name '*-config.zip' -delete
-
@dragoangel I can get into single mode, but I don't know how to mount the usb thumb drive.
-
@kcallis simply use Google for this, pfSense is FreeBSD based, so mostly manual for FreeBSD can work with pfSense.
Try:mount -v -t msdosfs /dev/find_your_drive_here /mnt/
or
mount_msdosfs /dev/find_your_drive_here /mnt/
try Tab to see possible commands to use in console when write first part of command =)
-
@dragoangel Thanks... I couldn't find the proper type!!! msdosfs!!! I was calling it all sort of other names.
-
@dragoangel @viragomann The problem is be squared away and thanks for all the pointers!