Community discussions

MikroTik App
 
gpetrom
just joined
Topic Author
Posts: 15
Joined: Sat May 14, 2011 11:07 am

Backup and restore Issue

Tue May 23, 2023 6:33 pm

Hi

Routeros version 7.9 stable

I am backing up mikrotik with the below command
export show-sensitive file=backup
When i am testing to restore and i am doing it with the following command it fails
system/reset-configuration no-defaults=yes run-after-reset=backup.rsc
I am able to restore if i replace in the file false with no and true with yes.

Am i doing something wrong?
Is this a bug?

Thanks in advanced
 
holvoetn
Forum Guru
Forum Guru
Posts: 5317
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: Backup and restore Issue

Tue May 23, 2023 7:52 pm

To be exact: this is not backup / restore.
This is export / import.

But you may be on to something... never noticed it before.
 
User avatar
nichky
Forum Guru
Forum Guru
Posts: 1275
Joined: Tue Jun 23, 2015 2:35 pm

Re: Backup and restore Issue

Wed May 24, 2023 5:57 am

You need to edit the file:

First - On top of the script you should be adding :delay 15.

Second - The file should be attached into the disk flash

Than u can go with
system/reset-configuration no-defaults=yes run-after-reset=backup.rsc
Should work on v7 , even though i didn't try as yet.
On v6 works perfectly fine.
 
gpetrom
just joined
Topic Author
Posts: 15
Joined: Sat May 14, 2011 11:07 am

Re: Backup and restore Issue

Mon May 29, 2023 9:42 pm

To be exact: this is not backup / restore.
This is export / import.

But you may be on to something... never noticed it before.
Well i think that this is the safer solution to backup. Why?
What if you have a backup from 6 version routeros and you have upgrade it to 7 will it work to restore from backup file?
I am not sure at all, and i am not sure even if you have upgrade it from the same version for example from 7.1 to 7.9
Yes in the rsc file i will have to make adjustments but finally i will make it work.
You need to edit the file:

First - On top of the script you should be adding :delay 15.

Second - The file should be attached into the disk flash

Than u can go with ]
No this is not working in 7
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3169
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: Backup and restore Issue

Mon May 29, 2023 10:17 pm

As to which one is "better" that a subjective question. You can BOTH do an export & backup as they both have their uses :).

A backup file contains certificates, while an export would not. An export is human-readable and largely/somewhat version and platform independent, but is it not the complete. They way I look at is use import to create a new router from an old one. But for stuff like being able to "rollback" a change, backup/restore is the way to go since all the MAC/.id etc will remain the same.

RouterOS doesn't enforce a version and platform checking on restoring a backup, so it will "somewhat work". But it's a bad idea. The benefit becomes the curse: since backup does restore MACs and other ID/certs/etc, that creates also sorts of associated problems from duplicates on the network. Similar with versions, it depend on how different the version and specific config commands were actually same. I believe cross-fig will still run upon a restore operation, so theoretically config would migrate from V6 to V7, but doesn't make it a good idea.

RSC is generally way to go, but it's not hard to always have the actual backup file too. If you need no-default=no to make an /sys/reset-conf file=x.rsc work (with a :delay in RSC ;))... that sounds like a bug in the V7 export that it's not including something needed. Using export verbose show-sen may be help, but make the config less readable (and potentially problematic since attribute name sometimes still are changing in v7)... Lot of choices here. Do several just in case ;)
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3169
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: Backup and restore Issue

Mon May 29, 2023 10:21 pm

One way to troubleshoot this is to reset the router to no-default=yes with NO file. Then using MAC in winbox to connect to it, copy your file and use "import export.rsc verbose=yes". This will show you what line it might be getting stuck on.
 
User avatar
k6ccc
Forum Guru
Forum Guru
Posts: 1490
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: Backup and restore Issue

Tue May 30, 2023 1:53 am

As to which one is "better" that a subjective question. You can BOTH do an export & backup as they both have their uses :).
Highly recommended!

I have a nightly script that creates a backup and an export. Those are then sent via E-Mail to one of my E-Mail accounts, and also sent via ftp to my file server.

Who is online

Users browsing this forum: rplant and 62 guests