Backup and restore the device settings?

While setting up my new USB dongle, I accidently factory reset the device by, I guess, unplugging it while it was on. Hours of customizations, package installations and mounts are now gone… :frowning:
Moving forward, is there a way for me to backup the device in a way that’ll allow me to quickly restore if this happens again? Note that I’m using an SSD that cannot be easily removed from the device, it’s not an SD card I can just take out and duplicate.

Luckily I create that huge post with all my installations with Plex and everything, will need to go through my own guide now…

Hi,

You can backup your system in LuCI:

  1. Navigate to LuCI → System → Backup / Flash Firmware → Actions: Backup.
  2. Click Generate archive button to download the archive.

It backs up core config files (/etc/config), custom scripts, a list of installed packages (you then reinstall the packages by running opkg install after restoring).

**
Disable USB Restore

As Raspberry Pi devices lack a physical reset button, the USB removal to reset provides a way to do that (especially as PiFi is commonly used travelling and the ability to flash an SD card isn’t always possible).

If you prefer to disable USB restore (so removing the USB doesn’t reset) then you can remove the following file:

rm -f /etc/sysp/pifi_factory

then reboot to ensure the file isn’t cached.

If your OpenWrt isn’t available and that function is removed, you may be able to restore by using either a USB-to-ethernet adapter (which would default to LAN to connect to a computer and visit 192.168.3.14) or re-flashing the SD via Raspberry Pi imager.

But generally, keeping back-ups is best way. Also likely to add in-app backup option soon too.

I may indeed disable the usb restore for now, because what worries me is that while setting up the pi, the system went through “factory reset” several times, and only the first time was because I unplugged the USB, the other times just happened spontaneously. Perhaps it’s because of the Argon case, where the USB is connected to the case. Maybe when I restart it first disconnects the USB port which triggers the factory reset? I’m not sure. Anyhow, thanks!