Community discussions

MikroTik App
 
lurch
just joined
Topic Author
Posts: 23
Joined: Mon Jan 24, 2022 5:45 pm

converting .backup to plain text

Tue May 17, 2022 2:06 pm

I have a .backup file but when i load it the router becomes unreachable via it's configured ip, I can reset the router and load the file onto it but how do i read/convert the .backup file so I can fine the cause of the issue?
 
rbrtre
just joined
Posts: 5
Joined: Thu Mar 07, 2019 6:34 am

Re: converting .backup to plain text

Tue May 17, 2022 2:54 pm

Try another device. I recently killed an AP radio and when I connected it to CAP as soon as it started communicating over wifi, it rebooted. If your part of hardware is faulty, setting it up with config might cause the system to stop responding.
 
User avatar
evince
Member
Member
Posts: 355
Joined: Thu Jul 05, 2012 12:11 pm
Location: Harzé - Belgique
Contact:

Re: converting .backup to plain text

Tue May 17, 2022 4:50 pm

Hello,

You need to create .rsc file (readable)

Go to terminal and type : export file=(the-name-you-want), then go to FILES and download it.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: converting .backup to plain text

Tue May 17, 2022 5:01 pm

Hello,

You need to create .rsc file (readable)

Go to terminal and type : export file=(the-name-you-want), then go to FILES and download it.
This convert .backup to .rsc?
Is like you do not have read the OP...
 
tangent
Forum Guru
Forum Guru
Posts: 1351
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: converting .backup to plain text

Tue May 17, 2022 5:10 pm

export file=(the-name-you-want)

Yes, possibly coupled with "show-sensitive", "verbose", etc.

then go to FILES and download it.

That, or use SSH like a civilized being:

$ ssh myrouter /export show-sensitive > my-local-file.rsc

One command, and no need to dig through Files.

I've got a discourse on text versus binary backups that y'all might find helpful, including ideas for supplementing a text backup to get some of the advantages you normally have to resort to a binary backup for.

You don't have to use the linked script if you don't want to, but mining it and its docs for ideas is worthwhile.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: converting .backup to plain text

Tue May 17, 2022 5:21 pm

I have a .backup file but when i load it the router becomes unreachable via it's configured ip, I can reset the router and load the file onto it but how do i read/convert the .backup file so I can fine the cause of the issue?
Remember you can restore a .backup only to the exact same device where it was created.
Try to connect the router via MAC address instead of IP, then proceed as written by others (use /export to a file, download the file).
In the future, use /export instead of (or in addition to) backup. It produces a readable file, but it is a bit harder to restore and does not contain all the config.
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: converting .backup to plain text

Wed May 18, 2022 2:56 am

It's on my wishlist. Either an offline tool to extract readable config from binary backups, or enhanced export that can export everything. Preferably the latter. Maybe one day...
 
User avatar
memelchenkov
Member Candidate
Member Candidate
Posts: 202
Joined: Sun Oct 11, 2020 12:00 pm
Contact:

Re: converting .backup to plain text

Wed May 18, 2022 10:06 am

 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: converting .backup to plain text

Wed May 18, 2022 10:17 am

Only for @joegoldman:
If @lurch ask help for convert .backup file to .rsc file, because he have a problem restoring the backup,
what @evince has wroted do not help at all.
and do not (your words) "providing alternate solutions", because I do not see any "alternate soluction" on creating a new .rsc on resetted routerboard...
My reply
This convert .backup to .rsc?
Is like you do not have read the OP...
is perfectly adequate, because often, instead for reply with someting useful, the reply is not related with the problem, but just for reply something.
What @evince suggest is pretty useless at the moment.
@lurch do not want create a .rsc file from a working routerboard, but "convert" .backup to .rsc

What is wroted instead from @tangent, @pe1chl and @Sob is constructive and
@memelchenkov provide a soluction for read back the content of .backup file,
but later the problem is convert .dat(abase)? files on routeros commands.
It is still a start on right direction...
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3291
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: converting .backup to plain text

Wed May 18, 2022 10:20 am

This is why I always backup all my routers with both backup file and export config.
But its interesting that there are programs to unpack the backup file, never seen that before.

By converting the backup file, the OP my see why he can not reach or how to reach the router after backup file is restored.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: converting .backup to plain text

Wed May 18, 2022 10:25 am

2 Hints (if possible):
Open with something that boot RouterBOARD from ethernet, put back the .dat files on right place,
and try to start again the routerboard.
Use an x86 or CHR image, open with linux the virtual disk, put the file in place, and reboot...
Two ideas, but if hardware is not equal is hard to recover the .dat(a)?
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: converting .backup to plain text

Wed May 18, 2022 10:57 am

This is why I always backup all my routers with both backup file and export config.
But its interesting that there are programs to unpack the backup file, never seen that before.

By converting the backup file, the OP my see why he can not reach or how to reach the router after backup file is restored.
Well, those .dat and .idx files are binary so you will have a hard time to figure out how they relate to actual config.
About the only useful guide is that they have names that clearly reflect their purpose in the whole config...

Of course MikroTik have the code that converts this config into "export" format (it is the /export command in RouterOS), so it should be possible for them to put an online tool on the website where you can upload a backup file and download a corresponding rsc file, like there already is a tool to analyze a supout file.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: converting .backup to plain text

Wed May 18, 2022 11:11 am

Probably supout have same file strcture...
Converting .backp to supout for reading on web.... :roll:
 
msatter
Forum Guru
Forum Guru
Posts: 2897
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: converting .backup to plain text

Wed May 18, 2022 11:35 am

Crossfig is more sturdy so you can try to restore a v6 backup on a device running v7.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: converting .backup to plain text

Wed May 18, 2022 12:18 pm

Probably supout have same file strcture...
Converting .backp to supout for reading on web.... :roll:
No, supout is completely different from backup. It actually is easier to read, a tool for that exists as well and I tried it on a v7 supout
and it provides much more info than the supout reader on the site. One of the sections is an export. So when you have a supout file
you can actually use that to recover a device.
 
kirmad
just joined
Posts: 4
Joined: Mon Jun 27, 2022 9:42 pm

Re: converting .backup to plain text

Sun Jan 08, 2023 10:11 pm

Hi all,

I think I have the same problem described by @lurch

I configured my first Mikrotik device few months ago: a hAP ac3. It was running v7 and I downloaded a backup.

Now, I just bought a hAP ax3 and I would like to copy the configuration that I prepared for the old one.

The problem is that I do not have access to old one, and the only copy of the configuration that I have is a .backup. But I understand that I cannot just upload the backup to the new router...

Unfortunately, I didn't make an "export" when I had the old router.

Did you finally found a way to use the .backup file?

Thanks in advance
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 2865
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: converting .backup to plain text

Sun Jan 08, 2023 11:44 pm

.backup is a binary copy of configuration for particular device.
No possibility to restore it to the new one in a trusty way.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: converting .backup to plain text

Mon Jan 09, 2023 11:04 am

Indeed. The only thing you can try to recover it is loading the backup on the new device, then export it, netinstall the new device and use the export to manually recover some settings.
And you should only attempt that when you are familiar with netinstall and winbox connecting using MAC address.
If not, better start from scratch with the new router and forget about the backup.
 
kirmad
just joined
Posts: 4
Joined: Mon Jun 27, 2022 9:42 pm

Re: converting .backup to plain text

Tue Jan 10, 2023 1:56 am

Thank you very much to all.

I've finally managed to solve the problem.

First of all, to save some time to people who might try this, which didn't work for me:
The tool seems to work for v7, but it only extracts .idx and .dat files from the backup file, which are still codified (and it doesn't look like the tool is able to decode such files).
I even tried with another tool (https://github.com/0ki/mikrotik-tools) which seems to be able to decode the idx and dat files, but this is an old tool that needs Python2 (instead of 3. First problem) and when I made it work (the instructions are almost non-existing), still it didn't seem to be able to decode everything, so I would only get partial information.


Finally, I succeeded by trying something inspired by this message:
Indeed. The only thing you can try to recover it is loading the backup on the new device, then export it, netinstall the new device and use the export to manually recover some settings.
And you should only attempt that when you are familiar with netinstall and winbox connecting using MAC address.
If not, better start from scratch with the new router and forget about the backup.
So, instead of using a real router, I created a Hyper-V virtual machine with routerOS, restore my backup there... and it worked!
Instructions for the virtual machine are here: https://help.mikrotik.com/docs/pages/vi ... d=18350234

The only problem is that after the backup was restored, I didn't have network connectivity, but I was able to export the configuration to a file and copy it to a second virtual disk drive attached to the virtual machine with something like this:
/disk print
/disk format-drive (PUT_HERE_THE_DISK_NUMBER) file-system=fat32 label=flashdrive
/export file=disk1/exportfilename

Thanks!
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: converting .backup to plain text

Tue Jan 10, 2023 11:05 am

The only problem is that after the backup was restored, I didn't have network connectivity
That is where the "familiar with netinstall and winbox connecting using MAC address" comes in.
When you have such a noncommunicative device, you usually can connect to it when you have a winbox locally on the network and use the MAC address to connect instead of the IP address.
But that method you used is also valid.
Good idea to use a throwaway CHR instead of a real device, that avoids any risk of bricking the device.
(devices are normally never bricked but lack of familiarity with netinstall can bring you in quite some trouble)

Who is online

Users browsing this forum: Bing [Bot], cdblue and 45 guests