Kodi Community Forum
Migrate from flat folder structure for Movies - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Migrate from flat folder structure for Movies (/showthread.php?tid=348878)



Migrate from flat folder structure for Movies - NeBouse - 2019-11-01

Hi !

As the title says, I'd like to migrate from my current "flat folder structure" (movies) to the "1 movie = 1 folder" structure.
I already have a batch file that can auto create folder based on filename and move the file into it's folder.
Now I'd like to know if there is any way in Kodi not to have to scrape everything again from scratch (meaning re-downloading all artworks and movie infos) once I have moved every movie file in it's folder ?
Do I have to do something before moving files ?

Thx in advance.


RE: Migrate from flat folder structure for Movies - DarrenHill - 2019-11-01

The location of the file is part of the scraping process, and is stored in the database along with pointers to the artwork etc.

So your options are either editing the database (wiki) for every entry and updating the location of the media file therein, or just scraping again.

The latter is probably quicker unless you're very comfortable with database manipulation (and even if you are, back-up first). Indeed we normally strongly recommend not touching the db manually unless you really know what you're doing.


RE: Migrate from flat folder structure for Movies - Karellen - 2019-11-01

(2019-11-01, 13:36)NeBouse Wrote: Now I'd like to know if there is any way in Kodi not to have to scrape everything again from scratch
Yes. Export your library to NFO Files. See guide here... https://kodi.wiki/view/Import-export_library


RE: Migrate from flat folder structure for Movies - NeBouse - 2019-11-01

(2019-11-01, 17:46)Karellen Wrote:
(2019-11-01, 13:36)NeBouse Wrote: Now I'd like to know if there is any way in Kodi not to have to scrape everything again from scratch
Yes. Export your library to NFO Files. See guide here... https://kodi.wiki/view/Import-export_library  
Ok, many thanks for your answer.
So basically, and if I understood everything correctly :

- First I need to export my database using the "separate files" option, in order to create a .nfo file for each movie.
- Run my batch file to create folders and move .mkv files in each corresponding folder.
- Manually move each .nfo file to its corresponding folder. (now that I think of it, the batch file may also move the .nfo file in the corresponding folder).
- Do a library clean-up
- Do a library update

Am I right ?

One last question: should I export Thumbnails, Fanart and Actor thumbs ? or Kodi will recreate its cache from the links found in the .nfo files ?


RE: Migrate from flat folder structure for Movies - Karellen - 2019-11-01

(2019-11-01, 20:17)NeBouse Wrote: - First I need to export my database using the "separate files" option, in order to create a .nfo file for each movie.
- Run my batch file to create folders and move .mkv files in each corresponding folder.
- Manually move each .nfo file to its corresponding folder. (now that I think of it, the batch file may also move the .nfo file in the corresponding folder).
Yes.

(2019-11-01, 20:17)NeBouse Wrote: - Do a library clean-up
For such a major change to your library, I would recommend starting fresh otherwise your artwork cache will instantly double in size, and your database will be full of unwanted entries. If using Windows delete (or rename) the \roaming\Kodi folder, restart Kodi and a new userdata folder will be created. This will act like a fresh install, and you will need to add back whatever addons you had installed.

(2019-11-01, 20:17)NeBouse Wrote: - Do a library update
Yes


(2019-11-01, 20:17)NeBouse Wrote: One last question: should I export Thumbnails, Fanart and Actor thumbs ? or Kodi will recreate its cache from the links found in the .nfo files ?
Lots of variables to properly answer this question and depends on how you initially populated the library.
- Do you have local artwork already? If yes, then do not export artwork
- Did you use nfo file generated by a media manager to initially populate the library? (sounds like you did not) If yes, then you most likely won't have artwork links so no artwork will be downloaded. But you can easily check by opening an nfo file and looking for artwork links
- Do you have the advancedsettings entries to not modify cached artwork? If yes, then you can export your artwork if the above two points do not affect you. If you don't have the setting, you can still export artwork but it will be a reduced quality.
https://kodi.wiki/view/Advancedsettings.xml#Library_artwork


RE: Migrate from flat folder structure for Movies - NeBouse - 2019-11-01

(2019-11-01, 21:26)Karellen Wrote:  
(2019-11-01, 21:26)Karellen Wrote:
(2019-11-01, 20:17)NeBouse Wrote: - Do a library clean-up
For such a major change to your library, I would recommend starting fresh otherwise your artwork cache will instantly double in size, and your database will be full of unwanted entries. If using Windows delete (or rename) the \roaming\Kodi folder, restart Kodi and a new userdata folder will be created. This will act like a fresh install, and you will need to add back whatever addons you had installed.   
No i'm on Pi, but i can easily access the userdata folder.
I'm not really hot on deleting/renaming the whole folder since I have a few addons that took me time to configure (home automation, cinemavision, Hyperion and so on..)
Can I just delete the video database (.db file) and the Thumbnails folder ? is it enough ?
(2019-11-01, 21:26)Karellen Wrote: Lots of variables to properly answer this question and depends on how you initially populated the library.
- Do you have local artwork already? If yes, then do not export artwork
- Did you use nfo file generated by a media manager to initially populate the library? (sounds like you did not) If yes, then you most likely won't have artwork links so no artwork will be downloaded. But you can easily check by opening an nfo file and looking for artwork links
- Do you have the advancedsettings entries to not modify cached artwork? If yes, then you can export your artwork if the above two points do not affect you. If you don't have the setting, you can still export artwork but it will be a reduced quality.
https://kodi.wiki/view/Advancedsettings.xml#Library_artwork 
No local artwork at all, everything has been scraped from online services (with the default scraper for fanarts and Artwork beef for clearlogos).
This has been done recently (following a mistake from me) from scratch that's why I'm a bit reluctant to start once again from scratch ahah.
Also nothing in the AdvancedSettings.xml related to artworks resolutions.
So not exporting artwork seems to be the best option for me.

I want to do all of this just to be able to use the reviving TvTunes addon, this will be the cherry on the cake of my setup.

Many thanks for your help btw, greatly appreciated !!


RE: Migrate from flat folder structure for Movies - Karellen - 2019-11-01

(2019-11-01, 22:36)NeBouse Wrote: Can I just delete the video database (.db file) and the Thumbnails folder ? is it enough ?
Yep, deleting both of those items works also.

(2019-11-01, 22:36)NeBouse Wrote: Also nothing in the AdvancedSettings.xml related to artworks resolutions.
So not exporting artwork seems to be the best option for me.
Ok, then place those two entries into the advancedsettings.xml file, restart Kodi, then rebuild your library. This allows you to have full resolution artwork cached, which you can then export to your local folder. Should make it easier in future to rescan your library.

You are welcome Smile


RE: Migrate from flat folder structure for Movies - NeBouse - 2019-11-02

@Karellen 

Just an update to say that it worked flawlessly (except for my clearlogos but I didn't configure Artwork Beef correctly, no big deal though).
Again, many thanks for your help.