• sv.db to MySQL
    6 replies, posted
Hello, I'm getting despaired after searching the whole internet to find a way converting sv.db to MySQL. I've tried many methods but nothing really worked. Since I've started a second server, I want that both are mostly the same, concerning pointshop items and utime and more. I would really appreciate any help I get! Thanks in advantage
[URL]https://facepunch.com/showthread.php?t=1308430&highlight=[/URL] maybe this could help
I saw that post already but the link is dead :/
For pointshop you can use this: [url]https://gist.github.com/BlackVoid/b6f0ba1dd7e8ce46d7f9[/url] Should work with python 2/3 [code] # -*- coding: utf-8 -*- import sqlite3 conn = sqlite3.connect('sv.db') c = conn.cursor() sql = """SELECT `uid`, (SELECT value FROM `playerpdata` WHERE `infoid` = (`uid` || '[PS_Points]')) as points, (SELECT value FROM `playerpdata` WHERE `infoid` = (`uid` || '[PS_Items]')) as items FROM ( SELECT substr(`infoid`, 1, length(`infoid`)-11) as `uid` FROM `playerpdata` WHERE substr(`infoid`, -1, -9) = 'PS_Points' ) as p""" c.execute(sql) players = c.fetchall() with open("output.sql", "w+") as f: for k,v in enumerate(players): items = v[2].replace("\"", "\\\"") if v[2] is not None else "{}" f.write("INSERT INTO `pointshop_data` VALUES (%s, %s,\"%s\");\n" % (v[0], v[1], items,)) if (k+1) % 100 == 0: print("%s players converted." % (k+1,)) conn.close() [/code] If you know a bit of programming you can easily modify it to convert other addons using pdata.
Thank you for your answer, but I need this for PS2. I really don't know much about programming, I can read it but not write. I was thinking about a programm or something which can convert the whole .db to MySQL. All programmes I've found have a trial version and cost about or more than 100 bucks.
Any application which just moves the data from sqlite (sv.db) to mysql will not work for you. You need an script made to convert from the pdata table structure to whatever structure pointshop2 and the other addons uses, so you need a specialized solution.
I've made some advances: I got the file to .csv converted, but some important files such as kniv_items get erros at phpmyadmin. Ingame I just see "Pointshop is loading" But nothing happens. Any idea? :/
Sorry, you need to Log In to post a reply to this thread.