redis support / convert sqlite db

Post Reply
User avatar
fgr
Member
Posts: 86
Joined: Mon Sep 17, 2012 08:22

redis support / convert sqlite db

by fgr » Post

Hi,

its nice we get more and more new backend db's supported with minetest. One question come up in my mind: "how do i convert an existing sqlite3 db to the redis db? Is there any hint how this could be performed somehow?

TIA

User avatar
sfan5
Moderator
Posts: 3892
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: redis support / convert sqlite db

by sfan5 » Post

1) Set the connections settings in world.mt
2) run minetestserver --migrate redis --world /path/to/world/directory/
3) Done!

This is the same for converting to other backends except that you don't need connection settings for sqlite3 or leveldb.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
fgr
Member
Posts: 86
Joined: Mon Sep 17, 2012 08:22

Re: redis support / convert sqlite db

by fgr » Post

this argument will drop all sqlite3 contents to the new redis db?

User avatar
sfan5
Moderator
Posts: 3892
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: redis support / convert sqlite db

by sfan5 » Post

fgr wrote:this argument will drop all sqlite3 contents to the new redis db?
It will copy all MapBlocks (16x16x16 cubes of nodes) into the redis database and also update the backend setting in world.mt. The sqlite3 database will still be present but can then be deleted.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
fgr
Member
Posts: 86
Joined: Mon Sep 17, 2012 08:22

Re: redis support / convert sqlite db

by fgr » Post

thanks, will give it a try ... for performance tests.

User avatar
fgr
Member
Posts: 86
Joined: Mon Sep 17, 2012 08:22

Re: redis support / convert sqlite db

by fgr » Post

One question I have to the db contents on redis. How do you get persistence to work in case the server crashes? Will the hash entries be lost instead stored at the latest action within minetest?

User avatar
cHyper
Member
Posts: 842
Joined: Fri May 06, 2011 08:49
GitHub: cHyper-0815OL
IRC: cHyper
In-game: cHyper cHyper_0815
Location: Austria
Contact:

Re: redis support / convert sqlite db

by cHyper » Post

What are the main advantages of the new DB system?

User avatar
fgr
Member
Posts: 86
Joined: Mon Sep 17, 2012 08:22

Re: redis support / convert sqlite db

by fgr » Post

ignore my inputs prior:

the solution is to add all the information to the world.mt file like this:

Code: Select all

backend = sqlite3
redis_address = localhost
redis_port = 6379
redis_hash = minetest_pub
then use the command to start minestserver for migrate to redis

Code: Select all

./minetestserver --migrate redis
take a coffee and wait til it ends. ;)

Update: the migration process gives a core dump...

Code: Select all

20:43:37: ACTION[main]: Migrated 1225500 blocks 53.8197% completed
Segmentation fault (core dumped)

debug:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000527ea9 in Database_Redis::saveBlock(MapBlock*) ()
(gdb) bt
#0  0x0000000000527ea9 in Database_Redis::saveBlock(MapBlock*) ()
#1  0x000000000045da43 in main ()

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests