Kodi Community Forum

Full Version: Drive letter change
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone!
The other day my motherboard died, so I had to replace it and reinstall windows.
In doing so, I made a mistake, and chose the wrong drive letter, and now all my files that where on the F:\ drive are on the D:\ drive.
I already did a search for F:\ in the kodi folder, and replaced all ocurrances in a lot of xml, mainly the settings.xml of different add-ons and the xml of the different music albums.
Will this work? or are paths to files stored in someplace not as plain text?

thanks a lot!
They are stored in a database so if you want to change these you need to use SQL commands to change the paths.
Your best option is to change the drive letter back to the original letter (using Disk Management in Windows). Otherwise it is possibly better to start with a fresh database unless you know have some experience with SQL.
(2016-09-16, 15:45)PH-SYM Wrote: [ -> ]They are stored in a database so if you want to change these you need to use SQL commands to change the paths.
Your best option is to change the drive letter back to the original letter (using Disk Management in Windows). Otherwise it is possibly better to start with a fresh database unless you know have some experience with SQL.

The problem is that the Windows User folders are on that letter, you can't change that Sad
I just didn't want to lose all my watch history, I've been using xbmc for more almost 10 years Sad
Change all the references inside kodi back to where they were (ie on F:\) .
Make an advancedsettings.xml file and put a path substitution in it (see the wiki).
http://kodi.wiki/view/AdvancedSettings.xml
Path_substitution (wiki)
eg
Quote:<advancedsettings>
<pathsubstitution>
<substitute>
<from>F:\</from>
<to>D:\</to>
</substitute>
</pathsubstitution>
</advancedsettings>
That should work - if it doesn't you might have to do individual subs for each source.
That should get your library back up and running.

If you want to back up watched status I've used this with success:
164652 (thread)
Don't know whether it works for krypton yet.

Edit: if you're not already using it notepad++ has a search and replace function that makes life very easy when editing .xml files.
(2016-09-16, 16:12)trogggy Wrote: [ -> ]Change all the references inside kodi back to where they were (ie on F:\) .
Make an advancedsettings.xml file and put a path substitution in it (see the wiki).
http://kodi.wiki/view/AdvancedSettings.xml
Path_substitution (wiki)
eg
Quote:<advancedsettings>
<pathsubstitution>
<substitute>
<from>F:\</from>
<to>D:\</to>
</substitute>
</pathsubstitution>
</advancedsettings>
That should work - if it doesn't you might have to do individual subs for each source.
That should get your library back up and running.

If you want to back up watched status I've used this with success:
164652 (thread)
Don't know whether it works for krypton yet.

Edit: if you're not already using it notepad++ has a search and replace function that makes life very easy when editing .xml files.
Thanks a lot!
I'll give this a try.

When you say individual subs for each source, do you mean for Movies / TV / Music, or for each individual movie and TV Show? Meaning... F:\Shows should be enough, or do you think I'll have to do F:\Shows\Lost, F:\Shows\Suits, etc?
In Windows, you can assign multiple drive letters to the same drive.

Re-point all XML files to like they were before.

Right click on MyComputer, select Computer Management
Go to Storage -> Disk Management -> Select your drive
Right Click on the Drive -> "Change Drive Letter and Paths"

There you can add another drive letter. Both drive letters will point to the same physical drive.

Once everything it working, you can export your library into individual files, create a new library and re-import with the base/correct folder.

At least once a month, I export my whole library to its original storage location (as separate files). This way if I lose my Kodi library, I simply import the library and I have everything as it was during my last export.

HTH
(2016-09-16, 16:28)Feanor Wrote: [ -> ]When you say individual subs for each source, do you mean for Movies / TV / Music, or for each individual movie and TV Show? Meaning... F:\Shows should be enough, or do you think I'll have to do F:\Shows\Lost, F:\Shows\Suits, etc?
I think the example I gave should just work.
If not I mean a different substitution for each source set in sources.xml - eg presumably you'd have 1 source for movies, another for tv shows, maybe 1 for music...
(2016-09-16, 15:37)Feanor Wrote: [ -> ]Hi everyone!
The other day my motherboard died, so I had to replace it and reinstall windows.
In doing so, I made a mistake, and chose the wrong drive letter, and now all my files that where on the F:\ drive are on the D:\ drive.
I already did a search for F:\ in the kodi folder, and replaced all ocurrances in a lot of xml, mainly the settings.xml of different add-ons and the xml of the different music albums.
Will this work? or are paths to files stored in someplace not as plain text?

thanks a lot!

Did any of these suggestions work for you? I don't see that you responded if they did or not. I tried the advanced settings <substitution> and that did not work. 

While changing advanced settings can be very useful, I checked the Kodi Wiki and found this very disappointing bit of information:

2.9.3 pathsubstitution
Main page: Path substitution
Note: Path substition for "sources" and profiles is broken, and will NOT be fixed.

Does anybody have information on where the databases are located? Maybe try the SQL approach.

Setting paths back to original Kodi ones sounds like the typical Microsoft solution of resetting everything to their default installation settings, or to do a complete clean installation of your operating system.

Exporting entire library to original locations is also problematic if you had multiple drive locations. That could mess things up worse.

I don't know what version of Windows was referred to, but you can't assign multiple drive letters to drives in Windows 10. Check TenForums on that.
windows thispc
manage
disk management
click on drive right click menu chane drive letter or path