How to change path without having to re-add movies?
#1
After updating my system with an additional hard disk drive I find myself in a situation where the path to all my movies has changed from D:\movies to E:\movies.
Is there a way to change the path in the database without having to re-add all the movies?
Reply
#2
use a sqlite editor
Reply
#3
Why not just swap the drive letters in windows? If you insist taking the hard route, you'll either need to use an sql editor of some sort, or export the lib to xml, change paths, wipe the old db, then import the edited xml.
Reply
#4
FYI: How to change it in SQL is covered in the wiki.

http://wiki.xbmc.org/?title=HOW-TO:_Use_...base-files
Reply
#5
for that matter i configured all my sources through symbolic links, just like unix
check out : http://technet.microsoft.com/en-us/sysin...96768.aspx

with that im able to shift my offline media or anything around without rescanning it into xbmc!
Reply
#6
Thanx for all the tips!

My SQL competences being limited, I ended up using the export to xml->edit->import route. This worked farily well except that now all thumbs and fanart is missing. When I access Movie Information they are still available, but in the list view all I'm seeing is the standard missing thumb image.

Any ideas how I can get back the thumbs and fanart?
Reply
#7
Are you in library view?
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#8
It's in library view yes. I was able to re-add thumbs for indivudial movies thru into Movie Information but that was a bit too much work...

But nevermind, I ended up starting with a fresh database and re-adding all medias over night so now everything works beautifully Smile
Reply
#9
Next time, export to individual files - that will export your thumbs, fanart etc. along with the information to .nfo files. Rescanning is then a breeze.

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
#10
Next time there will not be a location to export to if I understand this correctly.
If you insist on not doing the simple thing by swapping the drive letters in Windows Disk Manager permanently, you would have to:
1. Swap drive letters to original configuration.
2. Export to individual nfo files with fanart and thumbs.
3. swap letters back.
4. rescan library
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.
Reply
#11
you can export to single files, even if your individual folder aren't exist anymore. just make sure you'll have the configured root folder accessable. xbmc will export all files to that folder, and reconstruct the folderstructure including fanart, thumbs and nfos!
Reply
#12
LaTropa64 Wrote:FYI: How to change it in SQL is covered in the wiki.

http://wiki.xbmc.org/?title=HOW-TO:_Use_...base-files

Finally I worked it out. Took me 2 evenings figuring out how to find-and-replace the first piece of file path meeting text criteria instead of replace one piece of file path in the middle meeting no criteria.

For anybody whom also is a SQL noob like me and wants to change only the beginning of a specific (not every) string, use the how to quoted above and look at my code

I had to change 'smb://CELLA/R' to '/media/1TB_External' and obviously keep the rest of the filepath intact.

The code is:

update path set strPath = 'media/1TB_External' || substr(strPath,14,length(strPath)-13) WHERE substr(strPath,1,13) = 'smb://CELLA/R';

The numbers have to be changed and correspond to the start or lengt of a string. So besides changing the "Find" and "Replace" text in my code you also need to change the corresponding numbers to make it work for your specific path change.

In substr(strPath,14,length(strPath)-13 13 is the lengt of smb://CELLA/R and 14 tells it from were to take it next.
So if your FIND text is (lets say) 4 characters you should change 13 to 4 and 14 to 5.
then
In substr(strPath,1,13) 1 is the starting point and 13 the end point.
So your FIND text is 4 characters in lengt then you should use strPath1,4 instead of 1,13

Good luck with it,

It worked for me
Reply
#13
So in my previous post I wrote that i finally fixed it.

That was, fixed the paths is the sql database. I wasn't there yet...

When I looked in my movies in library mode I was missing my movie covers.

so I looked at the library backup I made before and found out there was a xml file called moviedb.xml wich contains the file path linked to the images.

How To make a libray backup in XBMC: Go to Settings>Videos>Export Video Library
Choose a destination. In that destenation the moviedb.xml will be created along with some folders containing the images.

I changed the backed-up moviesdb.xml file using Notepad++ doing a FIND REPLACE (Ctrl+H)

And then I imported the total library through the XBMC interface(Settings>Videos>Import Video Library).

Now all my file path's were changed and all covers matched again.

This moviedb.xml I found in my export will probably be located somewere else on the system. Thing is I don't know were. And this worked for me.

greetz

one happy xbmc-enthousiast
Reply
#14
Thumbs Up 
Fantastic post, thanks for sharing ruben!

I've used XBMC since as long as I can remember on the Xbox. Recently switch to using on PC for HD content but I've never really had it looking as nice as it could be, instead opting for just file mode. This weekend I finally decided to sort it out and I'm now creating my libraries which involves a LOT of re-naming of files and amending file structure's etc.

I forever seem to be changing HDD's, re-installing windows etc so looking at all the possible 'what ifs' when those things happen and major one for me was of course keeping my existing library in tact.

After spending a good few hours researching how this would be possible only to find it appears extremely difficult involving SQL etc that I've never used I was starting to see this could be very problematic for what seemed such a simply task, ie change paths. Then, thankfully found the about post and it appears to have worked a treat! Simply solution to a simply problem. Smile

How you found any disadvantages or errors occurring after using this method or is everything still running ok for you?
Reply

Logout Mark Read Team Forum Stats Members Help
How to change path without having to re-add movies?0