Sign in to follow this  
vardoj

[Server] Windows app for Transferring characters between databases or Importing skill dumps

Recommended Posts

I threw together a little winform app that allows you to transfer your character skills, religion, affinities, titles, and achievements from one database to another.

 

Export:

 

u5mfJg6.png

 

 

  • Select DB will open a dialog box for you to select the wurmplayers.db file to act as the source database
  • Once selected, the dropdown box will populate with the players from that server, select the one you want to backup
  • Export button will go through the relevant tables in the selected database, creating a txt file with insert statements, for example:

 

yJ0guW7.png

 

 

Import:

 

CvQ8clZ.png

 

 

  • Select DB will open a dialog box for you to select the wurmplayers.db file to act as the destination database
  • Select Character File will open a dialog box for you to select the [charactername].txt file that was created during the export
  • Import will Insert/Update the character in the destination database with the values from the txt file. The character needs to already exist in the destination database, so create it there before attempting to import.

 

 

Import Skill Dump:

 

  • Pretty straightforward, choose the database, rename the skill dump file to name.txt (e.g. vardoj.txt) and then click Import. The character needs to already exist in the destination database, so create it there before attempting to import.
  • It will bring over all skills, and your faith/favor/alignment.  Select a god from the dropdown if this character is a priest.

 

 

 

NOTE:  MAKE A BACKUP OF YOUR WURMPLAYERS.DB BEFORE YOU GO HOG WILD!  I knocked this together in a couple of hours and briefly tested it against a couple of my database, so it has a "works on my machine" level of QA.

 

 

This does not bring over inventory, yet.  If I find some spare time I might look into inventory.

 

 

Links:

 

 

  • Latest Release (1.1.2) - make sure you download the exe, SQLite.Interop.dlland nlog.config and put them all in a folder together.  Once you start using the application it will create a "logs" folder that will help with troubleshooting issues.
  • Source code

 

Edited by vardoj
release 1.1.2
  • Like 5

Share this post


Link to post
Share on other sites

I've just tried it and it worked perfectly. Really simple to use - I didn't even have to worry about which directory to put the files in.


 


It didn't transfer my affinity or faith, etc., which would be a nice addition.


 


Thanks for this,


Share this post


Link to post
Share on other sites

I noticed last night that Titles are also missing.  I'll try to get some time in tonight to fix these issues and get a new release made.


Share this post


Link to post
Share on other sites

I was wishing i could do this the other day because i have a few maps that i like and wanted to use the same character on them both. 

Share this post


Link to post
Share on other sites

Version 1.0.1 is released and now exports Affinities, Achievements, Titles, and Religion:


 


1.0.1


  • Like 2

Share this post


Link to post
Share on other sites

Some work, others report "System.FormatException: String was not recognized as a valid DateTime." when you click Export

 

Not been able to nail down what causes this yet

  • Like 1

Share this post


Link to post
Share on other sites
On 2016-02-14 at 2:07 AM, solmark said:

Some work, others report "System.FormatException: String was not recognized as a valid DateTime." when you click Export

 

Not been able to nail down what causes this yet

 

I get that a lot.

Also, when trying to import: "Error loading character into db: SQL logic error or missing database

7 values for 5 columns"

Share this post


Link to post
Share on other sites

I'll try to get some time on it this weekend and look for that issue.

  • Like 1

Share this post


Link to post
Share on other sites

I added a new tab for importing a WO skill dump into a WU database.  Link to the latest release in the OP.

 

Just go into your settings for WO and make sure the "Save Skills On Exit" is checked, login the character in WO, logout and go find the txt file and rename it to your [characterName].txt (e.g. vardoj.txt).  If your character is a priest you can select the appropriate deity from the dropdown.  

 

On Windows the dump should end up somewhere around here:  C:\Users\$YOURNAME\wurm\players\$CHARACTERNAME\dumps.

Edited by vardoj

Share this post


Link to post
Share on other sites

long time between drinks it seems lol, nice work, sure will make it easier for those who need it.

Share this post


Link to post
Share on other sites
48 minutes ago, ozmods said:

long time between drinks it seems lol, nice work, sure will make it easier for those who need it.

 

Yeah when I fall off Wurm I tend to fall off hard.  I noticed that my post today was a year and a day after my previous post :(

 

The issue that Solmark reported, with the message "System.FormatException: String was not recognized as a valid DateTime." was caused by certain titles that had a single quote in them (e.g. "I'm Sawry") which mucked up the scripts.  I resolved that back in February.

 

The one that Skrofler found "Error loading character into db: SQL logic error or missing database 7 values for 5 columns", I have no idea :huh:  I haven't ever seen that error.  I suspect there were extra commas in the script somehow, but I'm not sure what the source would've been.

 

I'm planning on adding some detailed logging into the app to capture each step it is taking.  That would make it a lot easier to track down those issues.

Share this post


Link to post
Share on other sites

Release 1.1.2 has been created.  Adds detailed logging of the processes occurring.  You'll need to get the exe, nlog.config, and the SQLite.Interop.dll.  It will create a log folder and generate a file once you perform an action within the app.

Share this post


Link to post
Share on other sites

Thanks for the update. At first I didn't see a big use for this however I've come to use it to restore characters that have been purged from the database when an old player decided to come back. Not something I need to do but its nice, and its saved a lot of time.

Share this post


Link to post
Share on other sites

I've been working on adding the ability to transfer the character's inventory as well.  It's kind of there but something odd happens to most of the items where you can't get the right click menu on them, it just says refreshing forever.  Very strange because in my test case the character had 3 healing covers, two of them were fine (I can examine them and it tells me what you'd expect to see) and the other is bugged.  I've been digging through the database to try to figure out what could be causing that but I don't see any difference between those 3 items.

 

The server logging does sometimes show errors about Mesh when you try to right click on one of the bugged items:

WARNING com.wurmonline.mesh.MeshIO: data: 4194305, x: 24, y: 31066, size_level: 11, x | (y << size_level): 63623192 java.lang.ArrayIndexOutOfBoundsException

 

And my butchering knife thinks its a wall:  com.wurmonline.server.structures.NoSuchWallException: No wall with id 105115203845

 

I'll keep looking into it but I'm not optimistic about getting this working.

 

(edit: I've commited my current code if another dev is interested in investigating)

 

 

Edited by vardoj

Share this post


Link to post
Share on other sites

I've seen that happen before quite some time ago when I did some experimenting on my test server importing some items into the sql. Never got around to investigating it further honestly probably should have. Haven't had the item thinks its a wall bit, but have encountered the 'eternal refresh' issue.

Share this post


Link to post
Share on other sites
On 10/7/2017 at 0:30 PM, vardoj said:

And my butchering knife thinks its a wall:  com.wurmonline.server.structures.NoSuchWallException: No wall with id 105115203845

 

Lol, I gotta admit that made me laugh.

 

Given how recent your edit was, I assume nothing about the way the databases are handled has been changed in a way that would keep this from working?

I'll certainly keep it in mind incase I decide I want to transfer a character.

Share this post


Link to post
Share on other sites

I must be doing something wrong, when I import the files that are generated from a database to a new database the server won't accept it.

As if the file is corrupted or something.

Share this post


Link to post
Share on other sites

Error loading character into db The given key was not present in the dictionary.

 

Any ideas?

Spoiler

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at WurmPlayerExporter.Form1.btnImportDump_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
WurmPlayerExporter
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Martynas/Downloads/wu%20skill%20importer/WurmPlayerExporter.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
NLog
    Assembly Version: 4.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Martynas/Downloads/wu%20skill%20importer/WurmPlayerExporter.exe
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.ServiceModel
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ServiceModel/v4.0_4.0.0.0__b77a5c561934e089/System.ServiceModel.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Runtime.Serialization
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.Data.SQLite
    Assembly Version: 1.0.98.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Martynas/Downloads/wu%20skill%20importer/WurmPlayerExporter.exe
----------------------------------------
System.Transactions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

 

 

Edited by Martynas5

Share this post


Link to post
Share on other sites

Hi @vardoj

 

Are you able to update this for the new 1.8.0.3 release.

 

My use case is that I want to add a Login server to my cluster, so I am looking for a way to transfer skills, titles, achievements, faith, med path level etc and INV from an existing login server to a newly created one

 

Edited by solmark

Share this post


Link to post
Share on other sites

Each skill in the DB now has an ID which is server bound. So it's not possible to transfer skills directly between server DBs, this is what is causing corruption. To transfer skills in the DB, you need to generate specific skill IDs - it's not easily done. The server checks that the ID-chain is unbroken on start. Instead, you can transfer skills programmatically while in the server, by loading the skills in-game from a DB-file, and then set the skills to those values. I've published a mod that does just that:

 

 

  • Like 2

Share this post


Link to post
Share on other sites
On 10/22/2018 at 12:19 AM, Tenniel said:

Each skill in the DB now has an ID which is server bound. So it's not possible to transfer skills directly between server DBs, this is what is causing corruption. To transfer skills in the DB, you need to generate specific skill IDs - it's not easily done. The server checks that the ID-chain is unbroken on start. Instead, you can transfer skills programmatically while in the server, by loading the skills in-game from a DB-file, and then set the skills to those values. I've published a mod that does just that:

 

 

 

I thought I had used mine since 1.8.0.3 and it worked still but maybe not.  I'll try to look this weekend and see if I can modify mine to also work, otherwise it might be done.  Thank you for creating your mod!

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this