Script Idea: Library Database exporter

Discussion of plugin / script development for XBMC4Xbox
Post Reply
iceman-uk
Posts: 21
Joined: Sat Jul 20, 2013 11:22 am
Been thanked: 1 time

Script Idea: Library Database exporter

Post by iceman-uk »

Hi,

I normally upgrading my XBMC systems by FTP and do not retain the UserData settings. I start afresh so I get all the latest improvements. This is fine but I then have to re-scan all my media back to the Library. My idea is some kind of library exporter that will put the old library data into the new installation.

It should be possible as the library is "just" SQLite databases and files/dirs. So, is this something doable? Has it been done before?

The snag I can see is to cater for any schema changes that exist in a new release but that could be worked around as long as one has access to the diffs.

Thanks
User avatar
BuZz
Site Admin
Posts: 1890
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 65 times
Been thanked: 422 times
Contact:

Re: Script Idea: Library Database exporter

Post by BuZz »

User avatar
BuZz
Site Admin
Posts: 1890
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 65 times
Been thanked: 422 times
Contact:

Re: Script Idea: Library Database exporter

Post by BuZz »

or just copy your databases / wanted userdata from the previous installation
iceman-uk
Posts: 21
Joined: Sat Jul 20, 2013 11:22 am
Been thanked: 1 time

Re: Script Idea: Library Database exporter

Post by iceman-uk »

BuZz wrote:or just copy your databases / wanted userdata from the previous installation
Thanks Buzz, I'm learning new things about XBMC all the time.

I noticed slight differences between the files in UserData/ between 3.1 and 3.3 so my logic was that to be absolutely sure I have all the latest fixes/improvements, I should start with a new install and re-scan my media library.

I'm going to try the library export/import now.

Thanks
iceman-uk
Posts: 21
Joined: Sat Jul 20, 2013 11:22 am
Been thanked: 1 time

Re: Script Idea: Library Database exporter

Post by iceman-uk »

iceman-uk wrote:
BuZz wrote:or just copy your databases / wanted userdata from the previous installation
I'm going to try the library export/import now.
Just tried twice, it got to 53% first time (Free memory: 2MB), 2nd time it got to 63% (Free memory: 3MB). In each case I left it for 5 minutes at this point but it seemed "stuck". I am exporting to local E: or F: drive as "one file". The "separate files" option wanted to write to my SMB share and I didn't try it.

I think this is a function of my large library (all held on a remote SMB share) and maybe the exporter script being memory bound? Improvement would be to cache intermediate data to disk. Is there any way I can help improve this? Debug log etc.

Thanks
User avatar
BuZz
Site Admin
Posts: 1890
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 65 times
Been thanked: 422 times
Contact:

Re: Script Idea: Library Database exporter

Post by BuZz »

as the schema can change, you are better off copying the databases/userdata across. then new version will then update the schema.
iceman-uk
Posts: 21
Joined: Sat Jul 20, 2013 11:22 am
Been thanked: 1 time

Re: Script Idea: Library Database exporter

Post by iceman-uk »

What I did in the end was to install 3.3 fresh, boot into UnleashX, rename the UserData folder, then FTP over the UserData folder form another of my 3.3 XBMC which had all the Library scanned. Then cold restart.

It all worked, only oddity was that the old PM3 skin (default in 3.1) was still set.

I'll follow this recipe for the next big XBMC upgrade. In theory I now only have to sync the library once after a fresh install and then use that everywhere. I have one Xbox unit which is I in 720p/NTSC mode, I did not try this method on that one but I assume it will still work and just require some more settings tweakage.
User avatar
Dan Dar3
Posts: 1176
Joined: Sun Jul 08, 2012 4:09 pm
Has thanked: 273 times
Been thanked: 257 times
Contact:

Re: Script Idea: Library Database exporter

Post by Dan Dar3 »

Post Reply