MMMZZZZ / Jellyfin-Migrator

Script to migrate an entire Jellyfin database.
GNU Affero General Public License v3.0
161 stars 13 forks source link

Simple change of media location without move of database location not possible #6

Open rohrbrecher opened 1 year ago

rohrbrecher commented 1 year ago

So I've tried several things but either my config is wrong or my use case is not fully supported by the script at the moment.

I want to move my media from its current location (E:/Filme) to its new location on a NAS (\NAS/Filme or, if this doesn't work I will mount the folder to M:/Filme). The Jellyfin server is supposed to stay on the same machine, same location, no changes.

I created a copy of my database to C:/temp so that my main database (located in ...\AppData\Local\jellyfin) is not affected, but this is where my problem is. No matter how I configure the script, the changes are always done on the main jellyfin db and the defined output folder is empty.

My config currently looks like this:

log_file = "C:/temp/jf-migrator.log"

path_replacements = {
    "target_path_slash": "/",
    "E:/Filme": "M:/Filme",
    "E:/Serien": "M:/Serien",
    "%MetadataPath%": "%MetadataPath%",
    "%AppDataPath%": "%AppDataPath%",
}

fs_path_replacements = {
    "log_no_warnings": False,
    "target_path_slash": "/",
    "%AppDataPath%": "C:/temp/jellyfin_post/data",
    "%MetadataPath%": "C:/temp/jellyfin_post/metadata",
}

original_root = Path("C:/Users/Thomas/AppData/Local/jellyfin")
source_root = Path("C:/temp/jellyfin")
target_root = Path("C:/temp/jellyfin_post")

Since I don't want to move or copy my DB to another location I intentionally removed all the other parts of your example config. Maybe I made a mistake there.

My expectation was, that the script takes the info from C:/temp/jellyfin, performs all the replacements and then gives me the new database in C:/temp/jellyfin_post so that I can manually copy it to its destination (which is .../AppData/Local/jellyfin). But as I said before, the current behavior is, that the tool instead patches my main DB.

damonlynch commented 12 months ago

My experience is also that it simply overwrites the contents of C:/ProgramData/Jellyfin/Server, failing to copy anything to the target directory. Consequently, the jellyfin libraries are empty.

It makes no difference if source_root differs from original_root.

This is on Python 3.12 on Windows.

TheChilliPL commented 1 week ago

Windows 11, Python 3.9. The issue is present, although I don't think the changes are saved anywhere. The database file seems to not be modified at all, and the target_root doesn't even get created