Do we have map recovery/repair tool?

User avatar
linushsao
Member
 
Posts: 331
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus

Do we have map recovery/repair tool?

by linushsao » Thu Sep 17, 2015 05:47

it happen at last night,becuase of my old nb's(used to be my server) hard driver's problem(sector error or other).when i try to restart my world,i got error message and minetestserver stop.i guess my world map data has beed saved to the error sector of hd.

do we have any recovery/repair tool could rescue my map?
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: Do we have map recovery/repair tool?

by TenPlus1 » Thu Sep 17, 2015 08:46

This will hopefully recover your map so long as you are using linux with python installed...

Unpack both files into your .minetest folder contained in your home directory and edit the "recovery.py" file and change lines 25 and 26 so they point to your map files...

Finally open a terminal window and change to your .minetest folder and run this command (make sure recover.py has executable flag set):

./recover.py

...now just wait, anything salvagable will be written into new mapfile, anything corrupt will be marked as an empty block... good luck...
Attachments
fixmap.zip
(1.98 KiB) Downloaded 111 times
 

User avatar
linushsao
Member
 
Posts: 331
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus

Re: Do we have map recovery/repair tool?

by linushsao » Thu Sep 17, 2015 13:53

TenPlus1 wrote:This will hopefully recover your map so long as you are using linux with python installed...

Unpack both files into your .minetest folder contained in your home directory and edit the "recovery.py" file and change lines 25 and 26 so they point to your map files...

Finally open a terminal window and change to your .minetest folder and run this command (make sure recover.py has executable flag set):

./recover.py

...now just wait, anything salvagable will be written into new mapfile, anything corrupt will be marked as an empty block... good luck...


Tks TenPlus1,Tks for you help.

i had try but got error msg:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
File "./recover.py", line 41
    print "Block parse error:", pos[0], pos[1], pos[2]
                             ^
SyntaxError: Missing parentheses in call to 'print'


my setting of line 25/26:
source = r'/home/linus/.minetest/worlds/stable/map.sqlite'
target = r'/home/linus/.minetest/worlds/stable/newmap.sqlite'

do i have anything wrong?
 

User avatar
linushsao
Member
 
Posts: 331
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus

Re: Do we have map recovery/repair tool?

by linushsao » Thu Sep 17, 2015 14:04

solved, i replace line 41 with:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
print("Block parse error:", pos[0], pos[1], pos[2])
 

User avatar
linushsao
Member
 
Posts: 331
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus

Re: Do we have map recovery/repair tool?

by linushsao » Thu Sep 17, 2015 14:19

i got confused, after run recovery.py , i got many error,the output file "newmap.sqlite" got 3.0kb . i try another correct map,i got many error,too.
 

Exilyth
Member
 
Posts: 60
Joined: Sun Jul 28, 2013 18:46

Re: Do we have map recovery/repair tool?

by Exilyth » Fri Sep 18, 2015 00:35

I've got an idea for a map restore tool: saving a world in a working directory of a git repository and performing a commit whenever the server shuts down (or in regular intervals) might work. This would enable restoring the world to a certain commited state, but would require being setup just after the world is generated.

Ofc, regularly copying the world to a backup folder would be easier and would work too.

This is not very helpfull for the problem at hand though, sorry.
 

User avatar
linushsao
Member
 
Posts: 331
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus

Re: Do we have map recovery/repair tool?

by linushsao » Fri Sep 18, 2015 01:19

Exilyth wrote:I've got an idea for a map restore tool: saving a world in a working directory of a git repository and performing a commit whenever the server shuts down (or in regular intervals) might work. This would enable restoring the world to a certain commited state, but would require being setup just after the world is generated.

Ofc, regularly copying the world to a backup folder would be easier and would work too.

This is not very helpfull for the problem at hand though, sorry.


actually i had think about this idea for a while,using subversion.maybe it can be done also by simply a daily backup script for the worlds folder.but i also thought that maybe hd will not go wrong so fast...>_<. now i'm using my backup half mounth before.

it will be great if we could have this tools bundled into minetest in furture.
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: Do we have map recovery/repair tool?

by hajo » Thu Feb 23, 2017 22:12

linushsao wrote:
TenPlus1 wrote:This will hopefully recover your map
so long as you are using linux with python installed ... ./recover.py

i had try but got error msg: ...

So, has this tool been fixed, and successfully used on any minetest-server ?
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

User avatar
rnd
Member
 
Posts: 136
Joined: Sun Dec 28, 2014 12:24
IRC: ac_minetest
In-game: rnd

Re: Do we have map recovery/repair tool?

by rnd » Fri Feb 24, 2017 00:13

Tried both 1. recover.py method and 2. SQLite shell method. 2nd method restored some blocks 1st method didnt:

1. download http://www.sqlite.org/2017/sqlite-tools ... 170000.zip (if you have linux http://www.sqlite.org/2017/sqlite-tools ... 170000.zip)

2. unzip near your bad map.sqlite and run "sqlite3 map.sqlite"
a. inside bash shell write:
<bash>.mode insert
<bash>.output newdata
then exit bash (ctrl+c) when finished
3. run "sqlite3 newmap.sqlite"
a. inside bash shell write
<bash>.read newdata
and exit when finished

this produces error-free newmap.sqlite. You can delete temporary file "newdata". This method seems to be faster than python script.

However it was still not usable to satisfactory restore corrupted map on my server - too many missing chunks - seems all the ones where some recent activity happened. Water represents missing areas that were corrupted beyond repair

Image
Attachments
recovery.jpg
recovery.jpg (156.71 KiB) Viewed 1457 times
 


Return to Minetest General

Who is online

Users browsing this forum: No registered users and 12 guests

cron