Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:troubleshooting:backup_restore [2021/09/18 10:25] – [Introduction] someothertimedocs:guide-user:troubleshooting:backup_restore [2023/01/17 10:56] – [Introduction] vgaetera
Line 3: Line 3:
  
 ===== Introduction ===== ===== Introduction =====
-  * This how-to describes the method for performing OpenWrt file-level backup/restore. +  * This how-to describes the method for using OpenWrt file-level backup/restore. 
-  * Make sure to [[docs:guide-user:installation:generic.sysupgrade#savingrestoring_user-installed_packages|save and restore user-installed packages]].+  * Follow [[docs:guide-user:installation:sysupgrade.packages|Preserving packages]] to back up user-removed/installed packages.
   * Follow [[docs:guide-quick-start:admingui_sysupgrade_keepsettings|Preserving configuration]] to determine whether to keep the settings.   * Follow [[docs:guide-quick-start:admingui_sysupgrade_keepsettings|Preserving configuration]] to determine whether to keep the settings.
   * Follow [[docs:guide-user:installation:generic.backup|Generic backup]] for block-level backup/restore.   * Follow [[docs:guide-user:installation:generic.backup|Generic backup]] for block-level backup/restore.
   * Extroot or additional overlay setups require extra measures.   * Extroot or additional overlay setups require extra measures.
-  * In some cases full backup restore across major versions is not possible [[docs:guide-quick-start:admingui_sysupgrade_keepsettings#upgrade_compatibility|Keep Settings and Upgrade Compatibility]] 
  
 ===== Goals ===== ===== Goals =====
-  * Provide an easy way to restore OpenWrt to the previous configuration state.+  * Back up and restore OpenWrt configuration.
  
 ===== Web interface instructions ===== ===== Web interface instructions =====
Line 34: Line 33:
 ===== Command-line instructions ===== ===== Command-line instructions =====
 OpenWrt provides [[docs:techref:sysupgrade|Sysupgrade]] utility for file-level backup/restore. OpenWrt provides [[docs:techref:sysupgrade|Sysupgrade]] utility for file-level backup/restore.
- 
-The default upgrade on command line will automatically preserve basic OpenWrt configuration by saving and then restoring configuration files in default locations (/etc/config). This will preserve things like network settings, Wi-Fi settings, the device hostname, and so on. A OpenWrt command line upgrade by default preserves the following configuration files: 
-    * listed by ''opkg list-changed-conffiles'' 
-    * listed within the text files in ''/lib/upgrade/keep.d/'' (for example, ''/lib/upgrade/keep.d/base-files-essential'') 
-    * listed in ''/etc/sysupgrade.conf'' 
-For your information: Legacy setting behaviour of LuCI: There is a separate set of settings in the"config extern 'flash_keep' section of the file /etc/config/luci. In the past, it appears that this list was used by LuCI (see [[https://forum.openwrt.org/viewtopic.php?pid=100739#p100739|this post]]). However, LuCI upgrade procedure actually calls the sysupgrade script and so it appears the flash_keep settings in /etc/config/luci are now ignored. 
- 
-Note that custom installed packages and their own configuration will not be preserved, so it may be necessary to document your programs and save the settings that will need to be re-installed or restored after the upgrade. There are scripts available to deal with that automatically. Use ''sysupgrade -k'' and/or see [[docs:guide-user:advanced:opkg_extras|Opkg extras]]. 
  
 ==== 1. Customize and verify ==== ==== 1. Customize and verify ====
Line 50: Line 41:
 cat << EOF >> /etc/sysupgrade.conf cat << EOF >> /etc/sysupgrade.conf
 /etc/sudoers /etc/sudoers
-/etc/sudoers.d/+/etc/sudoers.d
 EOF EOF
  
Line 75: Line 66:
 ==== 3. Restore ==== ==== 3. Restore ====
 Restore previously saved OpenWrt configuration from local PC. Restore previously saved OpenWrt configuration from local PC.
 +Reboot to apply changes.
  
 <code bash> <code bash>
Line 83: Line 75:
 ls /tmp/backup-*.tar.gz ls /tmp/backup-*.tar.gz
 sysupgrade -r /tmp/backup-*.tar.gz sysupgrade -r /tmp/backup-*.tar.gz
 +reboot
 </code> </code>
  
-==== Debug ====+===== Extras ===== 
 +==== Backup settings ==== 
 +Backup combines multiple sources and covers most configurations by default. 
 <code bash> <code bash>
-grep . /lib/upgrade/keep.d/* /etc/sysupgrade.conf+# Automatically detected modifications 
 +opkg list-changed-conffiles 
 + 
 +# System configurations supplied by individual packages 
 +grep -r -e . /lib/upgrade/keep.d 
 + 
 +# User configuration to edit if necessary 
 +grep -e . /etc/sysupgrade.conf 
 + 
 +# Obsolete settings no longer supported 
 +uci show luci.flash_keep
 </code> </code>
 +
  • Last modified: 2024/04/28 11:01
  • by silejonu