Kodi Community Forum

Full Version: Moving media files (new path) without re-scraping?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
The main disk on my media server is full and I need to move movies and tv shows to another disk. That means a new path for all these files.

If I just move them, add the new disk as another source and scan it I guess I'll end up with duplicate library entries and re-scraped info, correct? And lost viewed status etc...

Is there an easy way to just update the filesystem paths after the move?

I've looked at the DB file in SQLiteSpy but I'm no database expert... I found the path table and the strPath column but I'm not sure updating just these values will be enough. There's also a idPath and strHash column etc...
Does anyone know if I can just update the strPath values and it'll work?
If so, can I search-and-replace all these values?
i.e. search for "smb://server/files01/movies" and replace with "smb://server/files02/movies"
I guess for that I will need to do a SQL query of some kind?

I'd love to see some kind of GUI tool for media file management (with preserved scraped info etc). Either built-into XBMC or separate.
You could export the database, edit the resulting text file, using any text editor, to change the path and import again.

Alternatively, on your server unshare the original "files01" share then share the new location as "files01". That way XBMC wouldn't realise anything had changed.

JR
Thank you for the reply!

So you think export/import is better/safer than editing the DB? And these export and import commands can be found in the XBMC GUI..?

Is there any risk of creating duplicate entries or is it completely safe if I only change the path values and nothing else?

I can't move all files to this new disk, otherwise your second suggestion would be the easiest way. I guess XBMC still doesn't support DFS or Windows symbolic links or NTFS junction points over SMB?

EDIT: I found some info about export/import here. I'll give it a try later!
Just a short update. Export/import worked in the end.

Export video library to single XML file -> search & replace paths in my trusty ol' text editor (UltraEdit) -> import video library.

This worked great on my xbmc test PC (my laptop) but on my HTPC it resulted in duplicate entries in the library. The clean database command fixed that however, and now everything seems to work, including "viewed status".

Probably much easier (and safer) than editing the DB directly.
Hi there,
I'm just bumping a bit this thread: I just spent some time looking around for how to move some of my video sources to another location.
I also found this Technazgul blog post http://www.technazgul.com/2011/02/how-to...while.html (manually edit the sql database) and this extension http://code.google.com/p/xbfm-file-manager/ (seems to be still in alpha status).
So I think I'll try the export/edit/import way first. The library is not so big so I can live with some additional scraping if only all the seen/bookmarks/etc. are saved correctly.

Since this post didn't come up easily I think it deserves a bit more visibility Smile

I'll report back here after success, could be some time tough.
2nd option, if this is an external HDD. just right-click on (My) Computer. Select Manage.
go to disk management. and change the drive letters:
Old Drive: D
New Drive: E

change old drive to F
change new drive to E
isamu.dragon Wrote:2nd option, if this is an external HDD. just right-click on (My) Computer. Select Manage.
go to disk management. and change the drive letters:
Old Drive: D
New Drive: E

change old drive to F
change new drive to E

Or, if all your sources were under c:\something you can mount an external drive (usb ecc.) under c:\something instead of a drive letter (move over the contents first). [Windows]

Of course if you are running on unix (linux) you can mount network shares and drives or drive partitions almost wherever you want.
Cthugha Wrote:Just a short update. Export/import worked in the end.

Export video library to single XML file -> search & replace paths in my trusty ol' text editor (UltraEdit) -> import video library.

This worked great on my xbmc test PC (my laptop) but on my HTPC it resulted in duplicate entries in the library. The clean database command fixed that however, and now everything seems to work, including "viewed status".

Probably much easier (and safer) than editing the DB directly.

I used this technique as well, and it worked well. In my case I moved my entire media library from c:\TvShows and C:\Movies to D:\TvShows and E:\Movies.
I use symbolic links in XBMC.

This means that I have a folder C:\data\dirs\ and within that there is a symbolic link for each TV show.

If I move the series to a different disc, I just have to delete the link currently in the c:\data\dirs folder and create a new symbolic link from the folder's new location.

As far as XBMC is concerned nothing has changed.

This is very quick and painless and works well.
Hi gmc99, what exactly do you mean with symbolic links? The c:\... path seems to show you are running on Windows. Do you mean shortcuts? NTFS Junction Points?

Or real symbolic links like in http://en.wikipedia.org/wiki/NTFS_symbolic_link ? I confess I always missed the existance of those, I found them with google right now.
Hi
Yes they are NTFS symbolic links.

See http://schinagl.priv.at/nt/hardlinkshell...llext.html for the Windows explorer Link Shell Extension.

I have data held on a number of NAS boxes, Windows Home Server and also local drives on the PC that XBMC is installed on.

The directory c:\data\dirs\ contains links to all the folders on each of the devices listed above.

All I did was selected all the folders in explorer, right clicked and selected "Pick Link Source" as an option.

Then pointing at the c:\data\dirs\ folder; right clicked again and did "Drop As" and "Symbolic Link".

XBMC is looking at just the content of the c:\data\dirs\ folder but when it does the scan it is actually looking at the location on the NAS or server etc.

If you move a folder from say, the NAS box to a local drive on the PC - all you do is delete the original symbolic link in the c:\data\dirs\ folder and replace it with a new one just for this folder using the Pick Link Source etc options above.

You have to delete the original one first as if you try and drop a folder with the same name twice; the second one gets called something like "Symbolic link of ....." rather than just the folder name itself.

It sounds complicated but it is really useful.

As I said earlier; as far as XBMC is concerned; nothing has changed regarding the location so it keeps details of what you have watched etc.

I hope that makes sense.

Glenn
@gmc99

Very Very Neat.

I'd say this is the best solution, period. Requires up front planning, though, so maybe a pointer to this should be dropped into the wiki - particulary somewhere in the Install / Quick Setup guide. But I'm to newby to mess this those on my own.

Still some internal / addon support for relocation, merge and split (db and icons) would be the best and cleanest solution. As a matter of fact a db copy function would be enough, with external manual file move and the "clean database" would then permit everything.
Old thread but i did not find any other solution to move my library than:

Export library (one file) --> Edit the xml with find & replace with the path of the new location ---> Import Library & Clean

Since my media files are all located in a NAS and according to the wiki of Filemanager: "Note that you are unable to copy or move files TO network shares, but you are able to copy (but not move) them FROM the network shares.", i couldn't do it throw it.
One question to this old thread: If you export, change and then import your library, I guess all watched statuses of the movies are gone? Or is it really just updating the movies? If so, people should not have had double entries in their library.
If all watched statuses will be gone, it would probably be faster in the end to edit the database directly.
For the future I will also go with symbolic links I guess, sound like a good idea to point all drives to one single folder and then beeing free to move stuff around on the disks.
(2014-03-25, 10:52)pigeldi Wrote: [ -> ]One question to this old thread: If you export, change and then import your library, I guess all watched statuses of the movies are gone? Or is it really just updating the movies? If so, people should not have had double entries in their library.
If all watched statuses will be gone, it would probably be faster in the end to edit the database directly.
For the future I will also go with symbolic links I guess, sound like a good idea to point all drives to one single folder and then beeing free to move stuff around on the disks.

I think so, yes. I avoid this by using the trakt addon, which automatically updates what you watched in your XBMC library.
Pages: 1 2 3