This is an old revision of the document!
https://jcutrer.com/howto/networking/mikrotik/perfectrestore-script
https://wiki.mikrotik.com/wiki/Manual:Configuration_Management#Exporting_Configuration
The backup function will backup and restore MAC addresses. Use the interface function
Reset MAC Address
to reset to the hardware MAC addresses.
Restore to the same version of RouterOS the backup file was taken from.
Export section by section and import one section at a time.
Sending e-mail is sensitive due to security. If you have problems, be sure to send from a valid account.
# Edit Mail Settings :local emailserverip "ip.of.mail.server"; :local emailfrom "XYZ Router <valid@fromaddress.tld>"; :local emailto "you@yourdomain.tld"; :local emailusername "validusername"; :local emailpassword "validpassword"; :local emailport "587"; /tool e-mail set from="$emailfrom" address="$emailserverip"\ port="$emailport" start-tls=yes user="$emailusername" password="$emailpassword";
# Automatic backup script :log info "Starting Backup Script"; :local SYSname [/system identity get name]; :put "Backing up $SYSname"; /system backup save name="$SYSname"; :log info "Backup pausing for 10s"; :delay 10s; :log info "Finished backing up configuration, sending e-mail"; /tool e-mail send to="you@yourdomain.tld" start-tls=yes subject=($SYSname . " backup") file=($SYSname . ".backup"); :log info "Backup pausing for 10s"; :delay 10s; :log info "Removing backup file"; :put "Removing backup file"; /file remove ($SYSname . ".backup"); :log info "Finished Backup Script";