I just bought another R7800 and I want to clone my current install to it. Is there a way to backup or snapshot my current OpenWRT installation to a file that can be imported into a new router?
The standard backup tarball should give you the key files assuming your're moving to identical hardware
If you are using an official build (release or snapshot), you could use attended sysupgrade to generate a new firmware image with the packages you have currently installed.
That would ease the installation of the same packages to a new router, in addition to the settings backup that was already mentioned.
find mtdx number for firmware
save firmware -> cat /dev/mtdx > firmware.bin
with scp copy file in a computer
with new router :
copy file in computer /tmp/tmp
mtd write firmware.bin firmware
I would not recommend the method described by @Annick as it is more prone to error -- manual mtd writes are best avoided unless necessary, and only in cases where you can be absolutely sure the hardware is 100% identical and that there aren't any issues with bad blocks in the memory, etc.. In this case, it is not necessary to use mtd writes.
As already stated, the standard backup tarball will transfer all the settings over without issue. The attended sysupgrade is useful if you have a bunch of user installed packages and it will also transfer the configuration, too. Or just create a custom image using the firmware sector (where you can then customize the image and add packages as needed), and use the backup file.
Before blindly moving your settings, make sure the hardware is identical (if they have different revision numbers, do research first)... there are only a few standard config files that are 'sensitive' to hardware differences (mainly the network and wireless files), but if there are differences, that could cause some headaches.
Yes with sysupgrade you can also backup full firmware ( save mtdblock contents & choose firmware for mtdblock )
Reflash after with sysupgrade if the hardware is the same ( uncheck keep settings )
Two things to consider:
- this approach is only possible at all (without manual filtering and careful consideration for each configuration item) if old- and new router are exactly the same model (and stay away from using
mtddirectly, that's just madness and prone to failure)
- even if both devices are the same (model) and the same OpenWrt version, the config backup still tends to contain device specifics like ethernet/ wireless MAC addresses and other device specific information, just blindly cloning this will cause problems (duplicate MAC addresses on the same network alone can cause your weeks of grief).
Take the time and set up the new router from scratch, using your backup only as reminder of the old settings (some configs, after careful consideration are easy to re-use than others, but at least the basics are better re-done).
Why not secure backup/restore with opkg extras?
Still not an option between different models, nor recommended (for the reasons above) to do between different devices of the same model.