Must clearly specified:
backup = ...backup! but for a) same device, b) same software version and c) same packages active,
export certificates, ssh host key, login users internal database, but
not the dude database,
export partially the user-manager (do not exports assigned profiles and other user-manager related thigs) and do not export the other files
a) different devices can cause loss of configuration on interface because MAC addresses do not correspond, and the "import" do not translate or adapt the change.
b) different software version have often differents commands, values and sections
c) obviously, if for example IPv6 is used on old and is disabled on new, IPv6 configuration is lost
export = ...intelligent backup! but is little more difficult to restore the devices, a) must be "resetted" without default values (literally blank),
the old config is b) everytime readable
do not export certificates, ssh host key, login users internal database, the dude database,
export partially the user-manager (do not exports assigned profiles and other user-manager related thigs), and do not export the other files.
But appropriate "export" or "save" can be made for save also the other things on red, except for the internal users passwords
a) the device must be blank, or any already present settings can interfere with import.
b) as text file, can be imported section-by-section, for find eventual differencies from original device and new (like less ethernet ports) or from different software version.
The config of not present packets or not present/changed interfaces is still readable.
This is how really made backup of all things on routerboard:
viewtopic.php?f=1&t=175360&p=858564#p858564
/certificate
:foreach cert in=[find] do={
:local certname [get $cert name]
export-certificate $cert file-name=("auto_$certname") type=pkcs12 export-passphrase=$certpass
}
# this create some files called auto_$certname.p12 for each certificate
/ip ssh export-host-key key-file-prefix=auto_host-key
# this create the files auto_host-key_dsa, auto_host-key_dsa.pub, auto_host-key_rsa, auto_host-key_rsa.pub to import back the host-key
/export file="auto_export"
# this create... auto_export.rsc
/user export file="auto_user_export"
# this create the export for internal user database auto_export.rsc but do not exports passwords!!!
/system backup save name="auto_backup" dont-encrypt=yes
# this create ... auto_backup.backup
/file remove [find where name="auto_user-manager.umb"]
/tool user-manager database save name="auto_user-manager"
# This create the User-Manager database backup auto_user-manager.umb but the already existant file must be deleted first
file remove [find where name="auto_thedude.db"]
/dude export-db backup-file="auto_thedude.db"
# This create the The Dude database backup auto_thedude.db but the already existant file must be deleted first
# And for all other files inside
/file
:foreach file in=[find where type!=disk && type!=directory && !(name~"dude/files/default") && !(name~"^auto_") && !(name~"dude.db\$") \
&& !(name~"db-...\$") && !(name~"user-manager")] do={
# place at this point a ricorsive /tool fetch upload than send the $file on ftp
}