sv.db to MySQL

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

http://forum.facepunch.com/showthread.php?t=1308430&highlight= maybe this could help

I saw that post already but the link is dead :confused:

For pointshop you can use this: https://gist.github.com/BlackVoid/b6f0ba1dd7e8ce46d7f9
Should work with python 2/3



# -*- 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\");
" % (v[0], v[1], items,))
		if (k+1) % 100 == 0:
			print("%s players converted." % (k+1,))

conn.close()


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? :confused: