• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support General Questions Moving libraries to a different disk

    Pages (2): 1 2 Next »

     
    • 0 Vote(s) - 0 Average

    Moving libraries to a different disk

    How to move libraries (on macOS)?
    jellyfin
    Offline

    Junior Member

    Posts: 49
    Threads: 9
    Joined: 2024 Nov
    Reputation: 0
    Country:Germany
    #1
    2024-11-22, 10:52 PM (This post was last modified: 2024-11-22, 10:54 PM by jellyfin. Edited 1 time in total.)
    I started my Jellyfin experience on an external Samsung T7 Touch SSD at my Mac Mini.
    After about 80 DVDs added to the libraries, I noticed that the disk is already nearly full and I am only about at half of my DVDs.

    So I copied all libraries to a bigger disk.
    And then ... I noticed that there is no option to set new locations in Jellyfin...
    This surprised me, as I thought this to be something that nearly every users will need to do at some point.

    As my disks are named for their type, the libraries are currently below /Volumes/T7_Touch1TB/{MOVIES,SERIES,...}
    They should go to /Volumes/CRUCIAL/MEDIA/{MOVIES,SERIES,...}

    I searched the Internet, but only found very crude manual steps for this and an old Python script for Docker and Windows.

    I then found this: https://github.com/jellyfin/jellyfin/issues/9922

    And the last comment was, that this was "completed" in September 2023, which gave new hope - but I cannot find nothing about this and cannot even find this request in the list of feature requests.

    Can anybody give me a hint wether this is possible and even somehow implemented in Jellyfin?
    I mean, it seems to be a very common requirement to move your libraries 😅🤗

    Many thanks for any hint!
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2024-11-22, 11:15 PM
    You can't "move" libraries, but you can add a new folder to the existing library.  Open the library settings and click the "+" at the top to add your new folder.  Then the "-" next to the old folder to remove it.

       
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    jellyfin
    Offline

    Junior Member

    Posts: 49
    Threads: 9
    Joined: 2024 Nov
    Reputation: 0
    Country:Germany
    #3
    2024-11-23, 12:12 AM
    (2024-11-22, 11:15 PM)TheDreadPirate Wrote: You can't "move" libraries, but you can add a new folder to the existing library.  Open the library settings and click the "+" at the top to add your new folder.  Then the "-" next to the old folder to remove it.

    That allows me to add the copy of a library folder and remove the old one WITHOUT loosing all my metadata?!?
    It does not sound like it will do this - more like just adding a new and empty folder in which I could then add new movies.
    That was not the goal, I want to use a different disk - with all my content and without any other changes (or losses) to Jellyfin!

    Like with any other App ...  most just say something like "cannot find folder xyz, please provide the right location" and them you can select the disk and folder where is stuff can be found.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #4
    2024-11-23, 12:53 AM
    In my experience, Jellyfin preserves metadata and watch status when I've had to move files around.

    In Jellyfin add your new folder to the library BEFORE you move your data. Once you've added the new folder you will STOP jellyfin completely. While Jellyfin is stopped you will move your files to the new folder. Before proceeding, you should backup your Jellyfin data directory so that you can restore if something goes wrong. You never know. Once the files transfer is complete you can then start Jellyfin. Scan your library and it should just remap all your existing metadata and watch status to the relocated folders. Once you've verified that you can remove the old folder from the library settings.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    jellyfin
    Offline

    Junior Member

    Posts: 49
    Threads: 9
    Joined: 2024 Nov
    Reputation: 0
    Country:Germany
    #5
    2024-11-23, 02:12 PM (This post was last modified: 2024-11-23, 02:13 PM by jellyfin.)
    (2024-11-23, 12:53 AM)TheDreadPirate Wrote: In my experience, Jellyfin preserves metadata and watch status when I've had to move files around.

    In Jellyfin add your new folder to the library BEFORE you move your data.  Once you've added the new folder you will STOP jellyfin completely.  While Jellyfin is stopped you will move your files to the new folder.  Before proceeding, you should backup your Jellyfin data directory so that you can restore if something goes wrong.  You never know.  Once the files transfer is complete you can then start Jellyfin.  Scan your library and it should just remap all your existing metadata and watch status to the relocated folders.  Once you've verified that you can remove the old folder from the library settings.

    Many thanks for this hint!
    Sadly, it did not work out - see the next post with all details.

    # Jellyfin: Moving Libraries on macOS

    I show what I did and how and then the result of this.

    ## Preparations

    tja@mini:~/Library/Application Support$ du -hs jellyfin/*
    1.1G jellyfin/cache
    28K jellyfin/config
    24M jellyfin/data
    924K jellyfin/log
    201M jellyfin/metadata
    16K jellyfin/plugins
    44K jellyfin/root

    I first stopped Jellyfin, then I created a backup of the above data:

    tja@mini:~/Library/Application Support$ tar cf ~/Library_Application_Support_jellyfin.tar ./jellyfin

    tja@mini:~$ ls -h Library_Application_Support_jellyfin.tar
    -rw-r--r--  1 tja  staff  1.3G Nov 23 14:25 Library_Application_Support_jellyfin.tar


    I prepared new folder for the new Library locations:

    tja@miniConfused-faceVolumes/XTRMQ$ mkdir -p MEDIA/{MOVIES,SERIES,PRIVATE,INTERNET,INBOX}

    tja@miniConfused-faceVolumes/XTRMQ$ find MEDIA -ls
      5322        0 drwxr-xr-x    7 tja              staff                224 Nov 23 14:27 MEDIA
      5324        0 drwxr-xr-x    2 tja              staff                  64 Nov 23 14:27 MEDIA/SERIES
      5327        0 drwxr-xr-x    2 tja              staff                  64 Nov 23 14:27 MEDIA/INBOX
      5326        0 drwxr-xr-x    2 tja              staff                  64 Nov 23 14:27 MEDIA/INTERNET
      5325        0 drwxr-xr-x    2 tja              staff                  64 Nov 23 14:27 MEDIA/PRIVATE
      5323        0 drwxr-xr-x    2 tja              staff                  64 Nov 23 14:27 MEDIA/MOVIES

    After that, I started Jellyfin again and added those empty locations as new Libraries to Jellyfin:

    Jellyfin webpage, Dashboard, Libraries, Libraries, Add Media Library

    I added the new folders and only enabled “Save artwork into media folders” and the 3 Trickplay options for all of them.

    For some unknown reason, the Library names all appeared with an appended “2”: MOVIES2

    I also face the first problem here: You cannot see which type a Library is, when it is shown as “Other”. I tried “Mixed Films and Programmes” and that was the wrong guess. I needed to use “Home Videos and Photos” for this Library instead.

    ## Moving content

    I then shutdown Jellyfin again, made new backup of the Jellyfin configuration, just to be sure:

    tja@mini:~/Library/Application Support$ tar cf ~/Library_Application_Support_jellyfin_2.tar ./jellyfin

    And then I moved my content:

    I made sure that the OLD folders did exist, but were empty and that the NEW folders contained the content instead.

    ## Restarting Jellyfin

    Then I started Jellyfin again, opened it’s webpage, entered the Dashboard and issued “Scan All Libraries” ... which did not do nothing at first, at least not visible. But with a later try, the progress bar appeared.

    After that I checked my new MOVIES2 Library - and found all of my metadata deleted!
    All movies have wrong names, changed or wrong images, other have no linking to a movie database anymore or point to an chinese version of the movie (one of the Star Wars movies)

    It’s like I started new!
    Horrible.

    To make this short: Jellyfin is the worst software I EVER encountered!

    It makes any migration nearly impossible, which is unheard of.

    I still think about trying those sqlite commands or if I just should open the old and new Libraries in 2 browser windows and redo everthing I did before, identifying and renaming stuff.
    jellyfin
    Offline

    Junior Member

    Posts: 49
    Threads: 9
    Joined: 2024 Nov
    Reputation: 0
    Country:Germany
    #6
    2024-11-23, 02:40 PM
    I tried to modify the SQlite database like this:

    tja@mini:~/Library/Application Support/jellyfin/data$ sqlite3 library.db
    SQLite version 3.47.0 2024-10-21 16:30:22
    Enter ".help" for usage hints.
    sqlite> .output library.sql
    sqlite> .dump
    sqlite> .exit

    tja@mini:~/Library/Application Support/jellyfin/data$ sed 's@/T7_Touch1TB/MOVIES@/XTRMQ/MEDIA/MOVIES@g;s@/T7_Touch1TB/SERIES@/XTRMQ/MEDIA/SERIES@g;s@/T7_Touch1TB/INTERNET@/XTRMQ/MEDIA/INTERNET@g;s@/T7_Touch1TB/PRIVATE@/XTRMQ/MEDIA/PRIVATE@g' library.sql > library.new

    tja@mini:~/Library/Application Support/jellyfin/data$ sqlite3 library2.db
    SQLite version 3.47.0 2024-10-21 16:30:22
    Enter ".help" for usage hints.
    sqlite> .read ./library.new
    sqlite> .exit

    tja@mini:~/Library/Application Support/jellyfin/data$ mv library2.db library.db
    tja@mini:~/Library/Application Support/jellyfin/data$ rm library.sql library.new


    Then I started Jellyfin again and scanned all media libraries.

    Result:

    All content gone from Jellyfin, totally.

    If I want to continue, I need to seek out the docs I found before and also check the old Python script, even as this was for Windows and Docker.

    As I said: Horrible!
    jellyfin
    Offline

    Junior Member

    Posts: 49
    Threads: 9
    Joined: 2024 Nov
    Reputation: 0
    Country:Germany
    #7
    2024-11-23, 02:54 PM
    I tried some other tricks, including modifying the jellyfin.db database files, but to no avail.
    Migration is not possible.
    Not in any acceptable way.
    jellyfin
    Offline

    Junior Member

    Posts: 49
    Threads: 9
    Joined: 2024 Nov
    Reputation: 0
    Country:Germany
    #8
    2024-11-23, 03:09 PM (This post was last modified: 2024-11-23, 03:10 PM by jellyfin. Edited 1 time in total.)
    I repeated the same with all 4 Sqlite databases I saw, there can be 2 more:

    Code:
    tja@mini:~$ cat ./jelly.sh
    #! /opt/local/bin/bash

    set -e
    set -u

    ####

    DIR="/Users/tja/Library/Application Support"

    cd "${DIR}"

    rm -rf jellyfin
    tar xf ~/Library_Application_Support_jellyfin.tar

    cd jellyfin/data

    for db in jellyfin.db library.db library.db-shm library.db-wal ; do
    cat << EOF | sqlite3 ${db}
    .output ${db}.sql
    .dump
    .exit
    EOF

    sed 's@T7_Touch1TB/MOVIES@XTRMQ/MEDIA/MOVIES@g;s@T7_Touch1TB/SERIES@XTRMQ/MEDIA/SERIES@g;s@T7_Touch1TB/INTERNET@XTRMQ/MEDIA/INTERNET@g;s@T7_Touch1TB/PRIVATE@XTRMQ/MEDIA/PRIVATE@g;s@T7_Touch1TB@XTRMQ@g' ${db}.sql > ${db}.new

    cat << EOF | sqlite3 ${db}2
    .read ${db}.new
    .exit
    EOF

    mv ${db}2 ${db}
    done

    exit 0

    That did not help either.

    The Libraries still point to the old location in the Dashboard and that cannot be changed in the Sqlite databases, it seems.
    jellyfin
    Offline

    Junior Member

    Posts: 49
    Threads: 9
    Joined: 2024 Nov
    Reputation: 0
    Country:Germany
    #9
    2024-11-23, 03:33 PM
    I think, I found a way for a clean migration!

    Going to post later in the other forum category, other checking and providing a script for it!

    Thanks again @TheDreadPirate !
    jellyfin
    Offline

    Junior Member

    Posts: 49
    Threads: 9
    Joined: 2024 Nov
    Reputation: 0
    Country:Germany
    #10
    2024-11-23, 03:52 PM (This post was last modified: 2024-11-23, 03:55 PM by jellyfin. Edited 1 time in total.)
    That was too early :-D

    While I found a way to change all pathes, I now have double as many movies - all movies show up 2 times, but both versions with the same metadata and the same location.

    I am short of giving up.
    Pages (2): 1 2 Next »

    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode