Cloud Backup

I see a note in the Release Candidate changelog:

cloud - added command “/system backup cloud” for backup storing to cloud (CLI only)

Interesting feature! But I imagine that my customers will have some questions as this feature comes out of beta, and I have some too:

  • What country are these backups stored in?
  • Are backup copies being stored in third-party datacenters / clouds?
  • What type of encryption is being used?

Thanks!

  1. Backups are stored in Latvia
  2. No 3rd parties
  3. only aes-sha256 encrypted backup files are accepted

More specifically, the backups are stored in MikroTik own datacenter, managed and accessed only by MikroTik, on MikroTik property.

Thanks for the replies guys! Much appreciated.

It would be great. But it better to learn fetch tool to upload file (backup) (multipart/form-data) over http(s) on my server?

Will these be only .backup files i.e. only restorable to the same piece of hardware? Or will it take config exports too? Even better, are .backup files being worked on so you can safely restore them across devices (same device type but different MACs etc)

I only use config expoorts myself at the moment but I hear of people having a lot of trouble trying to restore .backup files to a direct replacement device

Currently only backups for restoring on same device.

This is a nice feature, but it has one weakness: You have to remove the backup before uploading a new one. In case the removal succeeds but the upload fails you do not have a backup at all (at least in cloud). So you should consider to either

  • provide two upload slots, so one backup can be removed while the other is still available or


  • change the upload that removal is not necessary and backup is replaced on successful upload only.

The only time I needed a backup was when a device was broken. That does not work in the case?
I am currently using a script for the backup.

Back is for restore on the same device. If you restore a backup file on a different unit it will rewrite some configuration that might create issues for you.
I have a nightly backup script that sends e-mail. I get a backup file encrypted and also a export. Backup in case I F**k up and need to restore and export in case I need to change the unit.

Is the serial number the identifier for access to files? So only that unit can access the file?

  1. i would like winbox menu and not only cli.
  2. at winbox window (where is cpu,memory info etc) would be nice to show last backup date (if exist) or saying “this device is not backup to mikrotik servers”.
  3. when upload a backup for second time or more there should be a parameter “replace=yes” to overwrite current backup that exist on server. no need to apply the command “/system backup cloud remove-file number=0” before.

Kindis could you share your email backup script please?

Yes here they are. I have switched from E-mail backups to FTP. So now all routers upload to a FTP server that then send the backup offsite. The reason is that the ISP I have thinks the backup generated e-mail where a sign that my SMTP account had been hacked and changed the password all the time. Here are both script.
I which I could say that I’m smart enough to take credit for these but I’m not :slight_smile: I found the e-mail script on this forum and would credit the author if I remembered the name. FTP is just a slight rewrite which I did manage myself.

Email-Backup

:log info "Automated Backup Protocol Started"
:delay 2s
;log info "Creating Backup Files. This may take several minutes."
:local sysname [/system identity get name]
:local textfilename
:local backupfilename
:local time [/system clock get time]
:local date [/system clock get date]
:local newdate "";
:for i from=0 to=([:len $date]-1) do={ :local tmp [:pick $date $i];
:if ($tmp !="/") do={ :set newdate "$newdate$tmp" }
:if ($tmp ="/") do={}
}
:if ([:find $sysname " "] !=0) do={
:local name $sysname;
:local newname "";
:for i from=0 to=([:len $name]-1) do={ :local tmp [:pick $name $i];
:if ($tmp !=" ") do={ :set newname "$newname$tmp" }
:if ($tmp =" ") do={ :set newname "$newname_" }
}
:set sysname $newname;
}
:set textfilename ($"newdate" . "-" . $"sysname" . ".rsc")
:set backupfilename ($"newdate" . "-" . $"sysname" . ".backup")
:execute [/export file=$"textfilename"]
:execute [/system backup save encryption=aes-sha256 password=Backup_Encryption_Passsword name=$"backupfilename"]
:delay 5s
:log info "Sending Export File"
/tool e-mail send to="To_E-mail_Address" subject=([/system identity get name] . \
"_Automated_Backup") from="From_E-mail_Address" file=($"newdate" . "-" . $"sysname" . ".rsc") \
server=[:resolve "SMTP_Server_FQDN"] start-tls=yes port=587 \
password=password user=username
:delay 5s
:log info "Sending Backup File"
/tool e-mail send to="To_E-mail_Address" subject=([/system identity get name] . \
"_Automated_Backup") from="From_E-mail_Address" file=($"newdate" . "-" . $"sysname" . ".backup") \
server=[:resolve "SMTP_Server_FQDN"] start-tls=yes port=587 \
password=password user=username
:delay 5s
:log info "Sending Completed"
:delay 5s
:log info "Removing Backup files from router file list"
/file remove ($"newdate" . "-" . $"sysname" . ".rsc")
/file remove ($"newdate" . "-" . $"sysname" . ".backup")
:log info "Automated Backup Protocol Completed"

FTP Backup

:log info "Automated Backup Protocol Started"
:delay 2s
;log info "Creating Backup Files. This may take several minutes."
:local sysname [/system identity get name]
:local textfilename
:local backupfilename
:local time [/system clock get time]
:local date [/system clock get date]
:local newdate "";
:for i from=0 to=([:len $date]-1) do={ :local tmp [:pick $date $i];
:if ($tmp !="/") do={ :set newdate "$newdate$tmp" }
:if ($tmp ="/") do={}
}
:if ([:find $sysname " "] !=0) do={
:local name $sysname;
:local newname "";
:for i from=0 to=([:len $name]-1) do={ :local tmp [:pick $name $i];
:if ($tmp !=" ") do={ :set newname "$newname$tmp" }
:if ($tmp =" ") do={ :set newname "$newname_" }
}
:set sysname $newname;
}
:set textfilename ($"newdate" . "-" . $"sysname" . ".rsc")
:set backupfilename ($"newdate" . "-" . $"sysname" . ".backup")
:execute [/export file=$"textfilename"]
:execute [/system backup save encryption=aes-sha256 password=Backup_Encryption_Passsword name=$"backupfilename"]
:delay 5s
:log info "Sending Export File"
/tool fetch address=FTP_Server_IP src-path=($"newdate" . "-" . $"sysname" . ".rsc") user=username mode=ftp password=password dst-path=($"newdate" . "-" . $"sysname" . ".rsc") upload=yes
:log info "Sending Backup File"
/tool fetch address=FTP_Server_IP src-path=($"newdate" . "-" . $"sysname" . ".backup") user=username mode=ftp password=password dst-path=($"newdate" . "-" . $"sysname" . ".backup") upload=yes
:log info "Sending Completed"
:log info "Removing Backup files from router file list"
/file remove ($"newdate" . "-" . $"sysname" . ".rsc")
/file remove ($"newdate" . "-" . $"sysname" . ".backup")
:log info "Automated Backup Protocol Completed"

Thank you.

+1. Without two slots or a way to atomically replace the old backup with a successful new one, this feature is very limited in its usefulness. action=create-and-upload-replace would be the ideal way to do this.

when you upload file and print the information IP Cloud backup will return secret-download-key, using that you can get the file from anything running RouterOS

Hello everybody

My rb760 is dead, yesterday a thunder killed him, I made a backup using the mikrotik cloud but I lost my key to download it,Can I recover my backup? or can you send it to me? with my serial number and my mac address

Now that we have a replace mechanism since version 6.45beta42 one culprit remains:
If the cloud server is not accessible for any reason the commands in “/ system backup cloud” give fatal errors. You can not catch these as runtime errors from a script:

:do {
  / system backup cloud ...
} on-error={ ... }

On error the script will terminate in do-block. Any chance to fix that, janisk? (Already opened a ticket (Ticket#2019052022003204), but support told me this is not a runtime error. Meh!)

Hello, quick question, the change-log states that a “replace” command was added in 6.45.1, however if i do “action=replace” or if i just do action=tab no replace command is available.

Here is an example “/system backup cloud upload-file action=create-and-upload replace=cloud-XXXXXXXX-XXXXXX password=123”