Jellyfin Forum
Moving Server To New System With Different Username - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Moving Server To New System With Different Username (/t-moving-server-to-new-system-with-different-username)

Pages: 1 2


Moving Server To New System With Different Username - pavichokche - 2024-11-26

My server is running on Windows 11 and I'm migrating to Windows Server 2025. The issue I'm running into mainly is that the USERNAME for the user on the new system is different than the old one, and that's where my jellyfin configs and library are (%localappdata%\jellyfin\).

I tried to edit a couple of the files I could find references to the user name in and replace it with the new user name. That MOSTLY got things to work. The server started up, I could log in with my user and I could play back a show.

Before running the server installer on the new system, I also pasted in the Program Files\Jellyfin\Server directory, but I didn't edit anything in it.

However I started noticing a few strange things - the TV Shows library had every show marked as watched BUT inside the seasons/episodes had the correct status. Also, while I was able to play back existing episodes, the server was somehow not able to correctly access the directory where the shows are stored (all directories are identical on the new OS).
Then I checked the logs and once again there were still somehow references to the old username and that's where I set this aside and fired the old system back up.

Any ideas on how I can thoroughly replace references to the old username directory from all relevant files in order to do this migration? Is there something else I could be missing?


RE: Moving Server To New System With Different Username - TheDreadPirate - 2024-11-26

Are you talking about the Windows user name changing? If so, I don't see why you'd need to change anything IN jellyfin other than, maybe, file ownership.


RE: Moving Server To New System With Different Username - pavichokche - 2024-11-26

Here are some of the bits from the log file which reference the old user directory still:

[2024-11-26 00:45:36.222 -05:00] [ERR] [3] MediaBrowser.Controller.Entities.BaseItem: Error refreshing owned items for "C:\Users\old_username\AppData\Local\Jellyfin\root\default\Kids"
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\old_username \AppData\Local\Jellyfin\root\default\Kids'.

^ this one I got for each library and the collections library

[2024-11-26 00:26:30.832 -05:00] [INF] [14] Emby.Server.Implementations.ScheduledTasks.Tasks.CleanupCollectionAndPlaylistPathsTask: Item in "Christmas Movies" cannot be found at "C:\Users\ old_username \AppData\Local\Jellyfin\data\collections\The Santa Clause Collection [boxset]"

^ this one I got for each collection that I made myself

And that's about it...there were errors struggling to find the profile pictures for each user but I think the server sorted itself out because I saw them reappear later (at startup all the main directories are pointing to the correct place with the new windows username).



(2024-11-26, 03:27 PM)TheDreadPirate Wrote: Are you talking about the Windows user name changing?  If so, I don't see why you'd need to change anything IN jellyfin other than, maybe, file ownership.

Yes, the windows user name on the new system is different. There are a number of config files which point to locations in %localappdata (which as we know contains the user name). 
Editing those couple of files remedied most of the issues, but a few still persist, as seen in the log exerpts I shared above.

%localappdata%\jellyfin\config\config.xml:
<CachePath>C:\Users\new_username\AppData\Local\Jellyfin\cache</CachePath>
<MetadataPath>C:\Users\new_username\AppData\Local\Jellyfin\metadata</MetadataPath>


RE: Moving Server To New System With Different Username - pavichokche - 2024-11-26

In case it wasn't clear - I copied over my entire jellyfin data directory and program files server directory in order to "transfer" the server settings with no loss of metadata and user data.


RE: Moving Server To New System With Different Username - TheDreadPirate - 2024-11-26

Ah. Ok. I had assumed that all your data was in C:\ProgramData\Jellyfin, which wouldn't require this.

You will have to open jellyfin.db and library.db and find all instances of the old username and replace it. When I migrated from a direct Linux install to a Docker install, this is one of the steps I had to take.

DB4S is the app I used to open and modify the DB files.

https://sqlitebrowser.org/


RE: Moving Server To New System With Different Username - pavichokche - 2024-11-26

(2024-11-26, 04:23 PM)TheDreadPirate Wrote: Ah.  Ok.  I had assumed that all your data was in C:\ProgramData\Jellyfin, which wouldn't require this.

You will have to open jellyfin.db and library.db and find all instances of the old username and replace it.  When I migrated from a direct Linux install to a Docker install, this is one of the steps I had to take.

DB4S is the app I used to open and modify the DB files.

https://sqlitebrowser.org/

Amazing! Thank you so much!

I just had another thought which is so crazy it might just work - what if I just created a directory in C:\users\ ?
I could create \old_username\appdata\local\ and copy over the jellyfin folder there and keep all configs as they are...I could also create that directory but only put a symbolic link in it, pointing to the true %localappdata%\jellyfin where I'll move the server to. This way no matter what is sought after - old_username or new_username it would find the directory. Crazy, I know Grinning-face


By the way, why are some Windows servers storing their data in programdata and some in %localappdata%? When I first installed jellyfin (version 1.8 something) I think it set me up in programdata, but one of the updates that came soon after seemingly moved everything over to %localappdata%. I remember the day, it seemed like my server was broken and I figured out from the logs that it had started looking for configs in %localappdata%, so moving things there fixed things. But yeah...what's up with that?


RE: Moving Server To New System With Different Username - wenzelja - 2024-11-26

(2024-11-26, 04:28 PM)pavichokche Wrote:
(2024-11-26, 04:23 PM)TheDreadPirate Wrote: Ah.  Ok.  I had assumed that all your data was in C:\ProgramData\Jellyfin, which wouldn't require this.

You will have to open jellyfin.db and library.db and find all instances of the old username and replace it.  When I migrated from a direct Linux install to a Docker install, this is one of the steps I had to take.

DB4S is the app I used to open and modify the DB files.

https://sqlitebrowser.org/

Amazing! Thank you so much!

I just had another thought which is so crazy it might just work - what if I just created a directory in C:\users\ ?
I could create \old_username\appdata\local\ and copy over the jellyfin folder there and keep all configs as they are...

That might be the cleanest way to do it; create user [old username] in your new Windows Server, copy your jellyfin files/folders from old computer into new computer under C:\users\[old username].


RE: Moving Server To New System With Different Username - paulc - 2024-11-26

(2024-11-26, 04:28 PM)pavichokche Wrote: Amazing! Thank you so much!

I just had another thought which is so crazy it might just work - what if I just created a directory in C:\users\ ?
I could create \old_username\appdata\local\ and copy over the jellyfin folder there and keep all configs as they are...I could also create that directory but only put a symbolic link in it, pointing to the true %localappdata%\jellyfin where I'll move the server to. This way no matter what is sought after - old_username or new_username it would find the directory. Crazy, I know Grinning-face

I'd go with a directory junction to default location for a quick fix but edit the database to make change perm for future. Who knows what will change in the future.
mklink /j MyFolder ACTUALLOCATION

MYFOLDER = old username location

mklink | Microsoft Learn


RE: Moving Server To New System With Different Username - TheDreadPirate - 2024-11-26

If the server starts with admin permissions, Jellyfin will write to ProgramData. Otherwise Jellyfin data gets written to the user's local appdata. I've seen some users experience the issue you described of it changing directories after the fact. But I don't have enough info to base a hypothesis on besides "just Windows things".

Your idea for not having to modify data should work, though.


RE: Moving Server To New System With Different Username - pavichokche - 2024-11-26

(2024-11-26, 05:16 PM)paulc Wrote: I'd go with a directory junction to default location for a quick fix but edit the database to make change perm for future. Who knows what will change in the future.
mklink /j MyFolder ACTUALLOCATION

If I'm creating a junction to the user directory which the files are expecting (old_username %localappdata%), then what edits do I make to the database?

(2024-11-26, 05:20 PM)TheDreadPirate Wrote: If the server starts with admin permissions, Jellyfin will write to ProgramData.  Otherwise Jellyfin data gets written to the user's local appdata.  I've seen some users experience the issue you described of it changing directories after the fact.  But I don't have enough info to base a hypothesis on besides "just Windows things".

Your idea for not having to modify data should work, though.

I see, thank you for explaining. This must be what happened  - perhaps I installed Jellyfin as administrator but later ran the update(s) not as administrator and it carried on that way. Strange, though, I thought all of these application installers require administrator rights to run in the first place.