ZebMcKayhan
Very Senior Member
This is a continuation of a discussion sparked by @jsbeddow here.
This have been requested a couple of times, by me as well so I figured it is time to write down something to get things going.
This have been confirmed working on RT-AX86U running 388.9_2. Thanks for reporting @NoName79
There is no need to have Entware installed but its a good idea to have a usb drive connected to store your backups.
Even though the instructions are written for merlin, there is nothing known to me preventing these instructions to work on stock fw.
Update 5 sept 2025: changed to download already prepared config file from my github, instead of using the sample file and edit it.
Update 23 sep 2025: added fix for script not finding the varlist file.
This is my understand of what should be needed to get this done:
1. Install @Martinski script for saving subset of NVRAM variables:
2. Download the prepared config file that only saves nvram variables associated with Wireguard Server config:
3. Run the script in menu mode:
Note: you may get this error:
If that happens, press enter to continue into the script menu. Choose option "fl" to edit the path to the varlist. Paste in this path:
And press enter. It should now show this as green in the script as it is finding the file. You should only have to do this once.
Check under "dp" option so the path for saving backups are correct and proper. choose something differently if needed by selecting this option.
4. For backing up your Wireguard server, select option "bk". If everything is alright, the script will output each NVRAM variable its backing up. For sanity check, there should be 10 entries for the server peer itself and additionally 9 entries for each client peer. in my case with the server and 2 client I have 28 entries backed up.
If you ever want to double check which NVRAM variables are included in a backup file, use option "ls".
Please make sure the backup is made on usb drive. If it is placed under /jffs somewhere you will need to manually copy it somewhere since /jffs will be wiped during factory reset.
5. When you need to restore your wireguard server after a factory reset for example, you will need to install the script again (repeat #1-#3).
In the script, make sure option "dp" points to where the backups are from your previous backup.
To start restore, select option "rt". You will be prompted about which backup file in the target you wish to restore.
Reboot your router after a restoration:
As I have not been able to do this myself, I cannot tell you for sure it is working so if anyone tries this, please report back with your router model and FW version.
This have been requested a couple of times, by me as well so I figured it is time to write down something to get things going.
This have been confirmed working on RT-AX86U running 388.9_2. Thanks for reporting @NoName79
There is no need to have Entware installed but its a good idea to have a usb drive connected to store your backups.
Even though the instructions are written for merlin, there is nothing known to me preventing these instructions to work on stock fw.
Update 5 sept 2025: changed to download already prepared config file from my github, instead of using the sample file and edit it.
Update 23 sep 2025: added fix for script not finding the varlist file.
This is my understand of what should be needed to get this done:
1. Install @Martinski script for saving subset of NVRAM variables:
Code:
mkdir -m 755 -p /jffs/addons/SaveRestoreNVRAM
curl -kLSs --retry 3 --retry-delay 5 --retry-connrefused https://raw.githubusercontent.com/Martinski4GitHub/CustomMiscUtils/master/NVRAM/SaveRestoreNVRAMvars.sh -o /jffs/addons/SaveRestoreNVRAM/SaveRestoreNVRAMvars.sh && chmod 755 /jffs/addons/SaveRestoreNVRAM/SaveRestoreNVRAMvars.sh
2. Download the prepared config file that only saves nvram variables associated with Wireguard Server config:
Code:
curl -kLSs --retry 3 --retry-delay 5 --retry-connrefused https://raw.githubusercontent.com/ZebMcKayhan/Wiregard-Backup_AsusWRT_Server/main/NVRAM_VarList_wg-server.txt -o /jffs/addons/SaveRestoreNVRAM/NVRAM_VarList.txt
3. Run the script in menu mode:
Code:
/jffs/addons/SaveRestoreNVRAM/SaveRestoreNVRAMvars.sh -menu
Code:
**ERROR**: NVRAM variable list file [ /tmp/home/root/NVRAM_VarList.txt ] is EMPTY or NOT FOUND.
Press <Enter> key to continue...
Code:
/jffs/addons/SaveRestoreNVRAM/NVRAM_VarList.txt
Check under "dp" option so the path for saving backups are correct and proper. choose something differently if needed by selecting this option.
4. For backing up your Wireguard server, select option "bk". If everything is alright, the script will output each NVRAM variable its backing up. For sanity check, there should be 10 entries for the server peer itself and additionally 9 entries for each client peer. in my case with the server and 2 client I have 28 entries backed up.
If you ever want to double check which NVRAM variables are included in a backup file, use option "ls".
Please make sure the backup is made on usb drive. If it is placed under /jffs somewhere you will need to manually copy it somewhere since /jffs will be wiped during factory reset.
5. When you need to restore your wireguard server after a factory reset for example, you will need to install the script again (repeat #1-#3).
In the script, make sure option "dp" points to where the backups are from your previous backup.
To start restore, select option "rt". You will be prompted about which backup file in the target you wish to restore.
Reboot your router after a restoration:
Code:
service reboot
As I have not been able to do this myself, I cannot tell you for sure it is working so if anyone tries this, please report back with your router model and FW version.
Last edited: