• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Xml2sql tutorial

BarJuice

Zyloria Owner
Joined
Mar 28, 2008
Messages
118
Reaction score
1
Location
South Carolina
I'm not sure if this is in the right spot, and this is also my first tutorial.
I ran my old server using .xml for my accounts and players and wanted to update and move to The forgotten server using .sql for all that. I downloaded wrzasq's xml2sql converter and it took me a while to learn how to work it. So I'm going to try to explain how this worked for me the best i can, and hope that everyone else can do the same.

Before you start working, make sure to download xml2sql. heres the link http://sourceforge.net/project/showfiles.php?group_id=32523&package_id=202862
1.) you should already know how to set up an sql database, if not then search for a sql tutorial.

2.) go into phpmyadmin and import the database.sql file you want. It will be in your servers folder with config.lua. Mine was called forgottenserver.sql

3.) put the xml2sql.exe in the server folder you want to convert. (IE: "C:\Documents and Settings\Michael\Desktop\Tibia\ALLOTS\Zyloria Server" thats where mine went.)

4.) make a batch file to start it, or else it wont make the .sql file you need.
To do this open up wordpad.
type in the following: xml2sql.exe > xml2sql.sql
save it as xml2sql.bat

5.) use your batch file and you will see the program doing its thing. When it is finished you will have a xml2sql.sql file.

6.) go back into your phpmyadmin and import your xml2sql.sql file into your database you made earlier (remember my forgottenserver.sql i had to make? :p)

7.) It will take a while to import all the information, but it will go thru eventually.

Not all items will convert, and i dont think houses will either... BUT I'm sure people would much rather have their players back at least, ESPECIALLY in my current situation..

Moral of the story....
Never use xml, sql is so much better

Dont flame me too bad, ive never been a good teacher, but i hope someone can learn something from this.
 

Attachments

Last edited:
This tutorial is great :thumbup:

Now ppl won't hate me when im upgrading my server to SQL :p

SQL stopped to work at my server computer so I temporarly runned XML, when I get SQL to work again i'll be able to upgrade my server without everybody leaving the server because of acc/char reset :p
 
Thanks for this post. I think many has been looking for this. If it wouldn't be too much to ask. Would you like to attach your xml2sql.exe file to? I think people would appreciate that.
 
I did this, the SQL file was at about... 16.1MB, and maximum is 16.3KiB? :/ I think im in huge problems now :p
 
haha

Mine was only 5,261 kb
Dont know what to tell you...
You could split the file into 2 seperate .sql files and import them one at a time?
 
Big problem, I Think this doesn't work right.

The Group Id Flag of my user is above the mine.

Exemple:
My group flag is 6(It's because I'm adm) and the new character is 7, 8, 9, ...,200, ..., 1000.

edit:

Sorry about that, This program make a one group for each char with flag 0 for who isn't GM/GOD etc.
 
Last edited:
Big problem, I Think this doesn't work right.

The Group Id Flag of my user is above the mine.

Exemple:
My group flag is 6(It's because I'm adm) and the new character is 7, 8, 9, ...,200, ..., 1000.

edit:

Sorry about that, This program make a one group for each char with flag 0 for who isn't GM/GOD etc.

Just give all players group id 1, then give ur gm group id 3 again ;)

enter phpmyadmin, click on your database and SQL injections and execute this code:
Code:
UPDATE groups SET flags=0,name="Player" WHERE id=1;
UPDATE players SET group_id=1;
DELETE FROM groups WHERE id<>1;
And whollah, all players got group id 1.
 
Back
Top