Migrating from sqlite to mySQL
#1
Hi,

I am trying to migrate my databases from sqlite to mysql. While I was able to change my advancedsettings.xml to use a mysql database, I am still struggling to get the existing data from sqlite to mysql. I found a number of approaches on the web, but none of them really work.

Has anyone got a nifty script for that by any chance? Perl, Python, PHP etc. anything would be most welcome.

Thank you...

Toby
Reply
#2
Found this thread right after I posted. Had been looking for that thread for over an hour. Oh well... forget the question.
Reply
#3
Sorry if this is a stupid suggestion, I havent made the move yet.

Can't you just export the lib to disk and then re-scrap it?
Reply
#4
You can export and import apparently. I only found out about that after I posted. But it does not seem to work for me, anyhow. Now scraping does not work anymore at all.

Strange though: the database connection is up and running. There is some information written to the database, and when I imported from the export file, the database clearly had a couple of hundred entries.

As I could not see anything in XBMC, I deleted the database again (though it must have been working, sort of, since the import led to stuff being written to the DB).

Now if I add sources, or rescan old ones, the scan starts, and immediately stops, with no meaningful information (at least to me Wink) written to the log files.

So currently I am left with empty sources Wink So, if anyone can glean anything from the logs, I would be very grateful.
Reply
#5
A couple of suggestions, but its been a while since I set up the mySQL DB

Code:
<videodatabase>
<type>mysql</type>
<host>mercury</host>
<name>xbmc</name>
<user>xbmc</user>
<pass>cmbx</pass>
</videodatabase>

I recall from somewhere that you should use the IP rather than the hostname for your server. I'm guessing this is why you can't scan to the library.

Did you export to a single file or to individual files?

If it was a single file then the source from the sqlite db has to be the same as the mySQL source (eg: smb:\\mercury\media\movies - but you would want it to use the IP rather than hostname here as well). If the source is not the same then you can edit the exported xml file using notepad++ or similar and change all instances of the source to the new source. Then try dropping the mySQL video database, recreating it and reimporting (not sure if you have to drop the db but if its got nothing in it then it can't really hurt).

You can use something like heidiSQL to look at what is in your mySQL db and see if that helps explain what is happening.

Hope this gets you moving.
Openelec on ASRock ION 330 / Kodi on Win 7 PC
Reply

Logout Mark Read Team Forum Stats Members Help
Migrating from sqlite to mySQL0