Changing database paths
#1
Hi,

I have multiple htpcs that can run xbmc. The database resides on a nas (using symlinks for sharing) and all have standardized mounts with the same folder structures (/media/pool0X/X) pointing to nfs shares on the nas and other computers.

I currently have 2 zfs pools (01 and 02) and the rest (03-07) were scattered about on a mythtv box, laptop, etc. I have now consolidated pool03-07 to a new zfs pool on the nas.

Using Sqliteman (main > Tables > path), I tried editing all of the paths (from pool03-07) to now point to only pool03, so that all media played in file mode could be keep its info (bookmarks, etc).

When trying to commit the changes to database, I get the error:
Code:
There is a pending transaction in progress. That cannot be committed now.
Error: constraint failed Unable to fetch row
Perform rollback?

This seems to make sense as the database already contained an entry for /media/pool03/tv and editing /media/pool04/tv to /media/pool03 might create some sort of conflict.

So, my question is, what should I do to fix my database? Or, am I out of luck.

Thanks!
Reply
#2
What version?

If something recent (i.e. NEWER than Camelot) then export to XML, modify the paths to suit and reimport.

Changing paths in the database will not alter the paths used to cache thumbs otherwise.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Thanks, and sorry about leaving out the version. Currently using Pre-10.5 r32027. Working great too!

I was hoping the library export would work, but sadly it does not contain the paths I need to fix. All media files in the first two pools have been scanned into the library and are not moving location. The rest have not been scanned but many still contain bookmark information. All files already have .tbn and other file types needed to display art.

This is why I assume the 'path' section of the database should be edited. It contains path info from pool03+. Since the folder structures of the pools are identical (besides the /media/pool0X part), ideally I'd like to edit these paths to just point to pool03. However, it seems editing the database does not like containing multiples of the same path (like changing both /media/pool04/tv and /media/pool05/tv to /media/pool03/tv).
Reply
#4
Export to a single folder and you'll get an XML file with all the details (including paths) and all your thumbs and fanart etc.

Just edit that XML file to hookup your new paths, and reimport. Done.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
I have already tried the single file video library export. Scanning/searching through the large file only contains paths to those media files which have been scanned into the media library. However, nothing on pools03-07 has been scanned into the library! The media files have been viewed exclusively in File Mode, though xbmc kept track of bookmarks, resume points, etc.

Perhaps a better question is where is file mode information stored? If no in the path table of the database, where? Hopefully this is possible and they are not hard-coded or anything.

Thanks.
Reply
#6
Ah - in that case, yes, though bookmarks and resume points will not be exported. Only information in the library view itself is exported. A patch would be welcome to fix this issue!

Yes, they'll be in the path table of the database.

What you will need to do is delete the duplicates, then update all other tables where that item was referenced. If you don't have too many to do, then basically it would be:

1. Add new path to path table.
2. Update other tables that reference idPath to point to that new path.
3. Remove old path from path table.
4. Repeat.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Changing database paths0