Upgrading BackupToFTP Script to V7

Hi there.
I would be very glad if someone could help me to adapt this script THAT WORKED FINE Since upgrade to V7.
Unfortunately i Noticed that was not working only today, when my CHR with dude server stopped working and the last successful backup was on January the 24th.

PLEASE HELP ME!..
I am searching in documentation but I cannot figure how to make it work.

Especially DUDEDB Backup is not working and DATE and TIME is not correct.

:local saveUserDB false
:local saveSysBackup true
:local encryptSysBackup false
:local saveRawExport true
:local exportDude true

:local FTPServer "192.168.X.X"
:local FTPPort 21
:local FTPUser "backup"
:local FTPPass "XXXXXXX!backup"
:local PathPrefix "pcie1-part1/"

:local ts [/system clock get time]
:set ts ([:pick $ts 0 2].[:pick $ts 3 5].[:pick $ts 6 8])

:local ds [/system clock get date]
:set ds ([:pick $ds 7 11].[:pick $ds 0 3].[:pick $ds 4 6])

:local fname ("Backup-".[/system identity get name]."-".$ds."-".$ts)
:local sfname ($PathPrefix.$fname)

:if ($saveUserDB) do={
  /tool user-manager database save name=($sfname.".umb")
  :log info message="User Manager DB Backup Finished"
}

:if ($saveSysBackup) do={
  :if ($encryptSysBackup = true) do={ /system backup save name=($sfname.".backup") }
  :if ($encryptSysBackup = false) do={ /system backup save dont-encrypt=yes name=($sfname.".backup") }
  :log info message="System Backup Finished"
}

if ($saveRawExport) do={
  /export file=($sfname.".rsc")
  :log info message="Raw configuration script export Finished"
}

:if ($exportDude) do={
  /dude export-db backup-file=($sfname.".dudedb")
  :log info message="Dude DB Backup Finished"
}

:local backupFileName ""

:foreach backupFile in=[/file find] do={
  :set backupFileName ([/file get $backupFile name])
 
  :if ([:typeof [:find [/file get $backupFile name] "Backup-"]] != "nil") do={
    /tool fetch address=$FTPServer port=$FTPPort src-path=$backupFileName user=$FTPUser mode=ftp password=$FTPPass dst-path="BackupMikrotik/TheDudeServer/$backupFileName" upload=yes
  }
}

:delay 5s

:foreach backupFile in=[/file find] do={
  :if ([:typeof [:find [/file get $backupFile name] "Backup-"]]!="nil") do={
    /file remove $backupFile
  }
}

:log info message="Successfully removed Temporary Backup Files"
:log info message="Automatic Backup Completed Successfully"

Why you upgrade?

User-Manager no longer exist, on v7 is just another module with the same name.

Why you upgrade blindly without read all changelogs from v6?
Is all expected that the v6 scripts do no longer works on v7.

Yes it’s a stupid thing… but we supposed that newer firmware is safer than older one.

Unfortunately we didn’t know about this change in the scripts and we found ourselves in this situation

Maremma cinghiala… Manco avete controllato?

Il formato della data è cambiato (is written on changelogs…)
http://forum.mikrotik.com/t/warning-routeros-v7-10-will-break-all-scripts-based-on-system-clock-get-date-or-other-date-s/166576/1

prima:

{... :local ds [/system clock get date]
{... :set ds ([:pick $ds 7 11].[:pick $ds 0 3].[:pick $ds 4 6])

{... :put $ds

-22202-0

dopo (se non serve per forza “aug” ma va bene 08):

{... :local ds [/system clock get date]
{... :set ds ([:pick $ds 0 4].[:pick $ds 5 7].[:pick $ds 8 10])

{... :put $ds

20240822

quindi
:set ds ([:pick $ds 7 11].[:pick $ds 0 3].[:pick $ds 4 6])
diventa
:set ds ([:pick $ds 0 4].[:pick $ds 5 7].[:pick $ds 8 10])

Non ho nessun dude con la v7, per lavoro non la uso proprio la v7, quindi per la riga del dude non so aiutarti.
(no help for dude, I do not use it, I use only v6)

Grazie mille… ora controllo se le prime due sono ok… ma immagino di si… vista la prontezza con cui mi hai risposto.
Per il DUDE penso di aver risolto, ma devo fare due test.

Per gli aggiornamenti aihmè ho un collega che ha l’aggiornamento facile… gli staccherei quelle dita guarda…
Poi ci fosse uno che ha controllato se lo script funzionasse…

realizzo solo ora che sei l’autore del post

http://forum.mikrotik.com/t/warning-routeros-v7-10-will-break-all-scripts-based-on-system-clock-get-date-or-other-date-s/166576/1

grande lavoro!
Stavo cercando proprio li…

Grazie (Thanks)