v18 Change the name of my hard drive in the database
#1
Hello,

I have a very large database and I changed my hard drive, but I have to change the name of the hard drive.

So, if I change the name, all the paths of the files in the database will be wrong, so I have to redo all the scrapes of the movies, series, etc.

How can I simply change the name of all the paths in my database?

Rregards
Kodi on Raspberry Pi 2.
 
Don't Worry; Be Happy :-) Bobby McFerrin
Reply
#2
(2021-04-13, 12:40)Machou Wrote: How can I simply change the name of all the paths in my database?

How familiar are you with doing SQL queries, because that will be required when you want to change database contents.

First and foremost, make a backup copy of your database file(s), assuming you are not using a centralized database. Then start twiddling with the queries. Here is a wiki page on the matter, but do know that this page is based on a database of an earlier Kodi version, and has not been updated for Kodi 19 Matrix. You may to doublecheck on the fields using path contents.
Reply
#3
(2021-04-13, 13:18)Klojum Wrote:
(2021-04-13, 12:40)Machou Wrote: How can I simply change the name of all the paths in my database?

How familiar are you with doing SQL queries, because that will be required when you want to change database contents.

First and foremost, make a backup copy of your database file(s), assuming you are not using a centralized database. Then start twiddling with the queries. Here is a wiki page on the matter, but do know that this page is based on a database of an earlier Kodi version, and has not been updated for Kodi 19 Matrix. You may to doublecheck on the fields using path contents.
It was quite stressful but thanks Smile

It works perfectly for Kodi 18 & OSMC.

Just in case, for Freebox Delta:

1. Connect to Kodi, personally I use OSMC, so I went to get the file : /home/osmc/.kodi/userdata/Database/MyVideos116.db

2. Open with DB Browser for SQLite - https://sqlitebrowser.org/

3. Perform the following SQL queries:

sql:
UPDATE path SET strPath = REPLACE(strPath, 'smb://FREEBOX_SERVER/Ancien/', 'smb://FREEBOX_SERVER/Nouveau/');
UPDATE movie SET c22 = REPLACE(c22, 'smb://FREEBOX_SERVER/Ancien/', 'smb://FREEBOX_SERVER/Nouveau/');
UPDATE episode SET c18 = REPLACE(c18, 'smb://FREEBOX_SERVER/Ancien/', 'smb://FREEBOX_SERVER/Nouveau/');
UPDATE art SET url = REPLACE(url, 'smb://FREEBOX_SERVER/Ancien/', 'smb://FREEBOX_SERVER/Nouveau/');
UPDATE tvshow SET c16 = REPLACE(c16, 'smb://FREEBOX_SERVER/Ancien/', 'smb://FREEBOX_SERVER/Nouveau/');
UPDATE files SET strFilename = REPLACE(strFilename, 'smb://FREEBOX_SERVER/Ancien/', 'smb://FREEBOX_SERVER/Nouveau/');

Good =)

Thanks @Klojum
Kodi on Raspberry Pi 2.
 
Don't Worry; Be Happy :-) Bobby McFerrin
Reply

Logout Mark Read Team Forum Stats Members Help
Change the name of my hard drive in the database0