These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
12Next page
 

Building an SDE To xSQL conversion tool - Completed

First post
Author
Desmont McCallock
#1 - 2015-10-09 09:54:23 UTC  |  Edited by: Desmont McCallock
Tool can be found here.



Greetings, fellow 3rd party devs.

You may or may not know my SDE to SQL importer tool, in case you don't you can find more info here.

For those who don't know, the tool, in its current state, only imports the SDE back to an SQL Server.

Recently though, a fellow EVE capsuleer contacted me, asking me how he can produce an MySQL dump from the tool.
As you can imagine this is not possible, at the moment, but it got me thinking on adding a conversion ability to the tool, so it can produce dumps for various other SQL databases.

So, my questions for you fellow devs is:

1. Is there any interest, in adding such an ability to the tool?
2. If so, which SQL database should it support?
3. What should be the specs for the proposed database?


PS: I guess that most of you may be interested in MySQL and Postgresql. If this is the case, please be so kind and help me out by providing at least the basic specs (like what engine should be used for MySQL etc).

Thanks in advance.

Updates on project progress

  • Export to MSSQL data dump: Done
  • Export to Sqlite file: Done
  • Export to MySQL dump: Done
  • Export to PostgreSQL dump: Done
  • Export to CSV individual files: Done
  • Export to MS Access: Done
Hel O'Ween
Men On A Mission
#2 - 2015-10-09 14:35:12 UTC
Hi Desmont,

I'm working on a kind of similar tool right now, for other reasons. What I aim to do is to provide the ability for custom mapping by using a XML file to provide the desired mapping.

Using ADO, it holds the connection strings for both the source and the target database (which should already exist). And the mapping is simply defined as



Tables
   Table Name ="invCategories"
      Columns
         Column Name="categorieID" TypeTarget="(ADO DataType Enum value for source column) Size="" Precision=""
         Column Name="categorieName" TypeTarget="(ADO DataType Enum value for source column) Size="100" Precision=""
etc.


Maybe that's an approach that removes the need for your request: "If this is the case, please be so kind and help me out by providing at least the basic specs (like what engine should be used for MySQL etc)."

EVEWalletAware - an offline wallet manager.

Desmont McCallock
#3 - 2015-10-09 15:40:39 UTC  |  Edited by: Desmont McCallock
I was thinking more into providing the following:

* For MySQL and PostgreSQL to export a dump into a script file (.sql) which the user can then use to import it into the database.
* For SQLite to export a database file (.db) with the entire tables.

The above comes with the assumption that most would want the dump of their choice to be imported into a Linux machine.

For those who still would want to work on a Windows machine but with a different DB engine than SQL Server, I could implement an extra feature to automate the transfer between the DB engines. But that would be on a later scope.
Captain Thunk
Explode. Now. Please.
Alliance. Now. Please.
#4 - 2015-10-10 00:05:56 UTC
This is something CCP needs to do.

Reason being different people do different flavours of conversion and so parts can change meaning if you get too used to 1 guy doing a conversion, when he quits and he will, then you will have to start using the conversion whoever takes his place. Which will likely mean rewriting your apps to accommodate the changes.

It needs to be a single consistent conversion and CCP is by far best placed to do this.
Desmont McCallock
#5 - 2015-10-10 07:42:34 UTC  |  Edited by: Desmont McCallock
Captain Thunk wrote:
This is something CCP needs to do.

Reason being different people do different flavours of conversion and so parts can change meaning if you get too used to 1 guy doing a conversion, when he quits and he will, then you will have to start using the conversion whoever takes his place. Which will likely mean rewriting your apps to accommodate the changes.

It needs to be a single consistent conversion and CCP is by far best placed to do this.
Captain, you do have a point there, but CCP will never provide conversions, simple because it's moving away from having the entire static data in SQL (except the part where it's using sqlite).

The point where you are mentioning about the continuation of a created tool, has always been an issue, with many tools and they somehow find their way back, as long as they are OSS that is. So, if I where you I wouldn't worry too much on that scope.

The worrying part is that of the used schema. Steve Ronuken, that does the conversions till now, has a different db schema than me. We talked about creating a unified schema but it was not fruitful.

My idea of expanding my tool from plain importer to importer-converter, is coming just as an alternative choice.
Liquid Shock
Quantum Shenanigans
#6 - 2015-10-10 11:45:24 UTC
Is it possible to have a generic SQL exporter? I would imagine that there are data types that are common with the same keywords across the available RDBMS platforms. If you have CREATE TABLE and INSERT statements which are generic enough, then I imagine it would make things a lot easier for import.
Dragonaire
Here there be Dragons
#7 - 2015-10-13 18:33:50 UTC  |  Edited by: Dragonaire
If you follow SQL-92 standards it'll work in almost all DBs including even MS Access in many cases. The main place you'll run into any problems is with the schema(database) create since it's considered outside of the standards as well as settings up access rights for everything for those DBs that use them. There maybe a few things with the table create as well with several non-standard extensions of the syntax which are useful / needed being the most common cause here. The actual columns and any indexes etc are going to work as long as you do use the SQL-92 defined types and not any of the many other "better" types that many of the vendors promote to insure lock-in to their products.

I personally don't use much of the SDE data in my eve stuff but a general tool to convert it to SQL that can be used any where would be a very useful thing for the third party developers that's for sure and I'd be willing to take some time to help out as well.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Desmont McCallock
#8 - 2015-10-14 06:51:17 UTC
Dragonaire, thank you very much for your comments. I will surely need your insights and knowledge, especially with MySQL which I believe you know best.
Captain Thunk
Explode. Now. Please.
Alliance. Now. Please.
#9 - 2015-10-14 09:02:59 UTC
Desmont McCallock wrote:
Captain, you do have a point there, but CCP will never provide conversions, simple because it's moving away from having the entire static data in SQL (except the part where it's using sqlite).


I mentioned it once to Foxfur or PrismX, I forget which, but they did agree in principle that the conversion process is a living nightmare due to it being spread across several formats (mssql, yaml, sqlite) and indicated that CCP doing an official mysql conversion isn't out of the question.

While the various formats are useful for smaller apps on platforms such as mobile, a traditional full server website will always benefit most from the mysql conversion. I don't think it's unreasonable to request a 'proper' mysql conversion that will remain consistent.
Desmont McCallock
#10 - 2015-10-15 07:33:56 UTC
Captain Thunk wrote:
Desmont McCallock wrote:
Captain, you do have a point there, but CCP will never provide conversions, simple because it's moving away from having the entire static data in SQL (except the part where it's using sqlite).


I mentioned it once to Foxfur or PrismX, I forget which, but they did agree in principle that the conversion process is a living nightmare due to it being spread across several formats (mssql, yaml, sqlite) and indicated that CCP doing an official mysql conversion isn't out of the question.

While the various formats are useful for smaller apps on platforms such as mobile, a traditional full server website will always benefit most from the mysql conversion. I don't think it's unreasonable to request a 'proper' mysql conversion that will remain consistent.
lol Captain. CCP never says NO, but they never say YES. Remember the famous Soon™.
Golden Gnu
Lobach Inc.
#11 - 2015-10-15 09:29:43 UTC  |  Edited by: Golden Gnu
@Desmont McCallock
1)
Yes, please start making conversions like Steve! 2 > 1
It's vulnerable with only one person doing it. Both to errors and real life. With two options, likelihood of errors is a lot smaller.
However, you really need to make it identical, even if it means you have to change your current scheme, to one you consider worse.

2) MySQL, because, it's so easy to install with XAMPP/WAMP etc.
I think it have to a UTF-8 charset, but, you would know that better than me Cool

EDIT:
I realise you just wanted to update the tool, not make the conversion yourself - but, you should, if you can Big smile

Creator of jEveAssets - the asset manager

"Download is the meaning of life, upload is the meaning of intelligent life"

Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#12 - 2015-10-15 11:15:13 UTC
Golden Gnu wrote:
@Desmont McCallock
1)
Yes, please start making conversions like Steve! 2 > 1
It's vulnerable with only one person doing it. Both to errors and real life. With two options, likelihood of errors is a lot smaller.
However, you really need to make it identical, even if it means you have to change your current scheme, to one you consider worse.



Heh. I started because the person I was depending on was slow.

They stopped, I kept going.

Still need to look into writing a python script to do the migration of the sql server data over to something else.

Once that's done, the set of scripts should handle pretty much any system that sqlalchemy understands.

I guess, after that, I could look into wrapping it up with QT so it just does everything, with a nice gui.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Golden Gnu
Lobach Inc.
#13 - 2015-10-15 12:55:42 UTC  |  Edited by: Golden Gnu
@Steve Ronuken
I just want to state that you're doing an epic job. It's in no way criticism of your awesome work.
You have helped keep jEveAssets up-to-date for as long as you have done the conversions and I thank you for that. :)

Preferable you would all work on the same tool, but, I think it would be great if more than one person was able to maintain the conversion tool and release new conversions, so, it's not as vulnerable. Of course, I can see how that is not easy to accomplish, as we all prefer different languages.

That is all :)

Creator of jEveAssets - the asset manager

"Download is the meaning of life, upload is the meaning of intelligent life"

Desmont McCallock
#14 - 2015-10-15 16:56:31 UTC  |  Edited by: Desmont McCallock
Mainly it's not about the languages we,as devs, use to write any tool that deals with the SDE, as it's about the schema in use.

At this point let me explain the reason behind me using the schema I use.

When CCP started exporting tables to yaml and dropping them from the SDE data dump, the first logical think I thought of doing was to re-create the tables as they were before, keeping the schema as it was before the drop.
This way the DB could keep a consistence and backwards compatibility for systems that already used that schema.
I just then re-insert the data in the appropriate columns and in case there are new data, that can fit in the same table, I just add additional columns.
In case the additional data needed to be on their own separate table, I create a new table but keeping in mind the way CCP was organizing the schema (if the data represented CCP dogma then the data went to a table named dgm[TableName]).

All the above seemed the appropriate way of doing the re-importation, the "CCP style".

Steve chose to go down another path and I totally have no objections on that. And to show you that there is no rivalry between us, I'll let you in into a little secret, as I'm also contributing to Steve's tool, either by advise or actual code (@Steve I haven't given up on the tool, it's just that RL and personal projects come first).

If I go forward and extend the tool to provide the ability for it to create dumps in other SQL formats, it will be totally up the user of the tool to create the conversion of their choice, at any time they chose to do it. The only obligation from the tool's part would be to keep a steady schema and compensate on any change CCP will do to the SDE.
And as the tool is open sourced, I don't believe that there will be any problem in the future, even if I quit at some point, as there are more than enough .NET/C# devs out there, playing EVE.
Desmont McCallock
#15 - 2015-10-20 19:45:06 UTC
I have decided to give this a try. For starters I'll be implementing the sqlite conversion and then the MySQL.
Is InnoDB the preferred engine for MySQL?
Dragonaire
Here there be Dragons
#16 - 2015-10-22 16:30:42 UTC  |  Edited by: Dragonaire
Desmont McCallock wrote:
I have decided to give this a try. For starters I'll be implementing the sqlite conversion and then the MySQL.
Is InnoDB the preferred engine for MySQL?

Yes it is and the default on newer versions. Just as a suggestion might look at some of the things I did in Yapeal to handle updates and schema changes. 'Console/Command/DatabaseUpdater.php' and 'Console/Command/DatabaseInitialer.php' are the main files to look at. I use SQL directly with some find and replace but you could probably do the same thing in yaml if that made more sense as well for this tool. Main ideas from it would be using a diff for anyone just doing an update or the full thing for anyone that is installing fresh etc.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Desmont McCallock
#17 - 2015-10-22 19:42:08 UTC  |  Edited by: Desmont McCallock
Dragonaire wrote:
Desmont McCallock wrote:
I have decided to give this a try. For starters I'll be implementing the sqlite conversion and then the MySQL.
Is InnoDB the preferred engine for MySQL?

Yes it is and the default on newer versions. Just as a suggestion might look at some of the things I did in Yapeal to handle updates and schema changes. 'Console/Command/DatabaseUpdater.php' and 'Console/Command/DatabaseInitialer.php' are the main files to look at. I use SQL directly with some find and replace but you could probably do the same thing in yaml if that made more sense as well for this tool. Main ideas from it would be using a diff for anyone just doing an update or the full thing for anyone that is installing fresh etc.
Well, the thing is that for starters I will be creating a dump file for MySQL by reading the data from the SQL Server. Don't know if diff is possible in this case. I would like to avoid connecting to both DBs atm. The idea is to produce a dump file that the user can deploy to any machine.
Dragonaire
Here there be Dragons
#18 - 2015-10-23 00:23:44 UTC
Just been thinking about the schema and how yours vs Steve's is different (Haven't really looked at them side by side yet) and what you might look at is SQL views. I looked it up and it seems SQLite supports them so it might be possible to come up with a common one you both like and just use some view to bridge any gaps from legacy stuff. That would allow everyone awhile to transition over without forcing everything to be done at once. The only limiting thing about them you might run into is most DB engines either don't let you or limit you about writing to the views vs what you can do with tables. This probably isn't really a problem in this case since everything should be read-only except for updating when CCP changes things where you'd just make changes to the base tables to start with.

Just to make sure I understand how your tool work currently to do the translations you go from the DATADUMPXXX.bak file after importing it into MS Server Express and importing all the yaml as well then extract everything back out for SQLite etc? Or do you go about it another way. I've grabbed your code from git but only had a little time to look at it today so a little background on the overall work flow and what to look at would be helpful and probably save me and others some time to understand the code as it is now Smile

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Desmont McCallock
#19 - 2015-10-23 08:22:23 UTC  |  Edited by: Desmont McCallock
Have a look at this conversation on github (https://github.com/ccpgames/eveonline-third-party-documentation/pull/32)
My schema atm is this (https://gist.github.com/JimiC/648318fd105ca73a5423).

The tool takes the datadump and restores it back to the SQL Server (doesn't have to be Express version but while it's free lets take that). Then it reads and parses the yaml file and writes to the DB and them reads the sqlite db and writes back to the DB. A simple process broken down in three steps.
Desmont McCallock
#20 - 2015-11-03 10:34:19 UTC
OP updated to keep you in the loop of project progress.
12Next page