Solved Possible to Change Media Location Within Database?
#1
I am in the process of migrating my media from a desktop computer to a raspberry pi file server. Kodi is running on a raspberry pi using a shared MYSQL database. Kodi sees the relocated database, but it still thinks the media files are stored at smb://SHOP/multimedia when it is now stored at smb://RASPBERRYPI/multimedia... short of rescanning the entire database (which completely obliterate the seen/unseen tag), is there a quick and easy way to find-replace SHOP with 192.168.1.15 in the database?
Reply
#2
So, I exported the databases to an sql file, ran an sed in-place search/replace, deleted the databases and re-imported the databases back into kodi. I did have to manually edit the sources for each directory, but that was better than having to rescan an entire database. Thanks.
Reply
#3
Why not use the Import Export function? See link in My Signature below.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#4
(2019-03-20, 06:13)Karellen Wrote: Why not use the Import Export function? See link in My Signature below.
Sure.... NOW you answer! lol ... that's ok. I like doing things the [hard] command line way. It teaches more about the underlying system than does the [easier] GUI way. Thank you, though. I will keep that in mind in case I ever need to do this again.
Reply
#5
I would have answered earlier, but I just logged on and saw your question Wink

Export is the easiest and simplest method to transfer libraries between setups, or rebuilding a library when performing a Fresh Start. It will also save your Watched, Play count and Resume points after setting that in advancedsettings.xml

Just don't use the Export Artwork option if you have local artwork.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#6
Since I have you here... like I said, I had to go into each video and music folder and [Edit Source] to change it from the SHOP hostname to a more generic IP address. Is there a way to do that in one search-replace command/action? You know... just for future reference Smile
Reply
#7
(2019-03-20, 03:28)rebeltaz21 Wrote: is there a quick and easy way to find-replace SHOP with 192.168.1.15 in the database?

An SQL database requires SQL queries to directly change its contents. Hacking a database is not for everyone, though.

There is a wiki page on the subject, but it's heavily outdated for the Kodi database version. And you really need to know what you're doing. Smile
Reply
#8
(2019-03-20, 07:34)Klojum Wrote: And you really need to know what you're doing. Smile 
 Well, since I did figure out how to modify the database on my own, I reckon I do fit that category Wink but... I do thank you for pointing me to that page. I answered a question I had about '2.5 Modifying Sources.' Thank you!
Reply
#9
Thread marked solved.
Reply

Logout Mark Read Team Forum Stats Members Help
Possible to Change Media Location Within Database?0