HOW-TO:Share libraries using MySQL: Wiki Edition
#18
(2013-03-21, 03:35)EddieB606 Wrote:
(2013-03-21, 02:50)Ned Scott Wrote:
(2013-03-20, 21:24)SchattenMann Wrote: i was wondering: why does the wiki guide doesn't say the user can simply export the SQLite database and import it on MySQL...

I mean it took me 15 min to do it after i got tired of fussing around with Import/Export database...

Didn't know it was an option. Can you tell me more about the steps involved?

Yes, please share because after several attempts, I just can't seem to get this to work right and it looks like I can't get any help. LOL

Sure,

Open your SQLite database with SQLite Manager Extension for firefox
Go to Tools - Options - Main - Characters to enclose the identifiers with = Grave Accents ``
Go to Database - Export Database

If you are starting a clean database you can just import the SQL file. My XBMC installation had already created a clean MyVios75 and MyMusic32 so i used that database instead of creating a new one therefor i will comment all "Create" stuff.

Open the file with Notepad++
Find and Replace "Drop Table" with "Truncate Table" -> this will make sure the tables are clean, don't do it if it's already a clean table
Find and Replace "Create Table" with "-- Create Table" -> my tables are already created, don't do it if it is a clean database
Find and Replace "Create View" with "-- Create View" -> my tables are already created, don't do it if it is a clean database
Find and Replace "Create Trigger" with "-- Create Trigger" -> my tables are already created, don't do it if it is a clean database
Find and Replace "Create Index" with "-- Create Index" -> my tables are already created, don't do it if it is a clean database
Find and Replace "Create Unique Index" with "-- Create Unique Index" -> my tables are already created, don't do it if it is a clean database

99% of the work is done. You probably should take a look and search for names with a ': Mike O'Dole for example. Your script will have this cases like Mike O''Dole and this will generate errors. You have two options:

either

Start Running your script and, when you have an error, solve it and run it again;

or

Find and Replace '' with \'
Find and Replace ,\', with ,'',

By now you should have nothing else to do but import the script. You can run it as many times as you want until it goes through. Don't worry to much with errors, just read them and correct it...if there are any it will be simple differences between SQLite and MySQL syntax.

Have fun your XBMC installation that is EXACTLY equal as it was before
Reply


Messages In This Thread
RE: HOW-TO synchronize XBMC between every room in the house: Wiki Edition - by SchattenMann - 2013-03-21, 14:25
Logout Mark Read Team Forum Stats Members Help
HOW-TO:Share libraries using MySQL: Wiki Edition2