Jump to content

Move the emby program files to a central location!


Recommended Posts

Posted

Hey team.
I know this has come up before, but ill raise it again.
Please consider moving the Emby system files to a centralised location! 

I just had a melt down and was about to post a warning not to upgrade to 4.6.7.0 after a simple mistake on my part, that could easily be avoided by relocating the Emby source files to a centralised location!

I just performed a complete green-field rebuild off my home server along with the first fresh install of Emby in something like 10 years. there were some drama's there in relation to what is backup up and what is restored via the server backup app. but otherwise I am happy with the new functionality and performance.

beside the point, like most, I have break glass admin log in and a general admin login for my windows server.
I have completed all the boring stuff using my initial admin login, which included installing Emby! 
but once done, i pack away the microserver and disconnect the KVM, its headless from here.

I've logged in my my normal admin account and had a last look over other systems before leaving it and noticed a new update on the emby dashboard. 

I figured why not, anyway you can guess what happened, yep, it installed a fresh copy under my currently logged in account and I promptly freaked out when it appeared to wipe my db and start from scratch.
after spending hours on it last week and manually re-creating all my collections I was about to consider a system restore when I realised my error! I logged out and restarted the server, this time logging in as the original admin account! yeah my supposed break-glass account  - which is now back to being my everyday account.

I wont lie, I'm not happy with this.
I know I'm not the only person to use Emby on a headless server, nor am I the only person to install emby on a windows server platform.
The user folders are protected and restricted in all windows platforms, I am certain that things would go smother if it was all installed centrally , somewhere like "C:\Program Files" maybe?

I don't recall seeing an option to install Emby for "all users or just the current" during the install, but that would be a clean way to separate it for existing people who are not interested in change.


I have a friendly rivalry with a mate who chose PLEX back in the day, he is currently laughing at me again. 



  


 

Posted

Note.
During todays carnage, I restored the "new" Emby install from an auto system backup made earlier today, it did very little, other then restore my users (all two of them) and their watched history (yeah that's nice) but! even though I have 1.3GB of local metadata images (actor images/ cover art etc.) it began a complete library scan and re-download which took 2 days last week. why? and it ignored my collections (as in the library was empty)- so I am not confident that they are backed up properly. it also does not restore other settings such as network options and subtitle settings. there are likely more things that would be nice to be backed up, but I don't have the time to look, and I don't intend to start again... unless you move the system files and "for some reason" it is required.  

Posted

Hi, we do support this already!!!

Emby installs differently on each platform based on guidelines or requirements of that OS.

On a linux/unix environment it's stored in a way not to require any specific username but to access the location you need to be an admin. It then creates an system "emby" user which the admin has to grant proper proper permissions across all media libraries and owner rights.  It's a more involved setup but is typical of that platform.

On Windows you can install Emby two different ways depending on which installing you choose to use.  You can go the setup.exe route which is the typical type of windows install where it follows windows guidelines and installs for the user logged in.  It then runs under that user's access so if they have access to the media, so does Emby Server.

If you prefer to have control over where Emby gets installed and want to install it on your E drive off the root you can.  You can do this with many windows programs and this is called a portable install.  If you look at our download site for Windows you will see both listed there:

image.png.d10a951575b27f7cefbf89ce21b71ae7.png

So on this page you have the traditional installer for the release version.  You have the portable version as well as the beta version (also portable).

The portable version is actually just a 7Z file (zip format) that contains the system folder.  You create a directory where you want to install Emby and then drop the system directory into it.  Inside the system folder is the executable file EmbyServer.exe which you can use directly or create a short to it (what ever you want).

Want you start EmbyServer.exe for the first time it will create the other directories you are used to seeing along with the data files and config files.  When a new version comes out you shutdown Emby, rename the system folder and drop the new one in.  Once your sure everything works well you can delete the old system folder or if space isn't a concern, keep a few versions of it handy.  I actually rename it to the version it was like Emby 4.6.4 then I also copy the data folder into that as well.  Now I also have the system runtime files and the database as it was before I did an upgrade.

But anyway, we have supported doing this for a long time. 

  • Agree 1
Posted

Good to know, but in all fairness, surely you guys could package that option in to the one installer?
On that note, you get used to certain things, and online installers that pause for prompts is one, not having a go, just saying.

I was aware of the portable install (the unpacked installer), but last time I used it was a few years back when I was having issues with a major update on my 2k12 server, it was too late at that stage to relocate everything, but I don't think you had those notes about using it in that fashion, and sure I didn't go looking this time.  it was suggested to me as a manual update option when the installer would not work. I expected that most system files would require the default location and could not just be placed where ever I chose.

Posted
7 hours ago, DUG said:

surely you guys could package that option in to the one installer?

Hi.  The problem is that the user has to set proper permissions in order for automatic updates to work if we install anywhere other than the user directories.  We had a ton of problems with this in the early days before we moved to these locations by default.  But, as mentioned, if you know what you are doing, you can control this yourself.

Thanks.

Posted
7 hours ago, DUG said:

I expected that most system files would require the default location and could not just be placed where ever I chose.

Yea, it isn't obvious at first, but in the end Emby is much easier to set back up than Plex. I just did a clean install of Win11 and all I had to do was copy the Emby Server directory to the new location and double click EmbyServer.exe. That was it. I added complexity by using the nssm service, but even that was easier than the 3rd party Plex service. I think the key is having the Emby Server directory backed up and ready to go when re-installing Windows AND leaving all media in the same place. As long as you do that it's really easy.

  • Like 1
Posted (edited)

Perhaps I'm hijacking the thread, but the next question in my mind is about how to migrate from Emby installed under a user profile to the portable install.  Is it as easy as copying the "programdata" folder from the original location to the portable install location? 

Example
  - Created c:\embyserver
  - extract zipped "system" folder to c:\embyserver (c:\embyserver\system)
  - run EmbyServer.exe and allow it to create programdata folder and then exit
  - rename programdata to programdata.clean
  - copy programdata  to c:\embyserver (c:\embyserverprogramdata)

This of course is assuming I know enough about Windows permissions to get around any problems to which @ebr alluded?

Edited by richt
clarify
Posted
2 minutes ago, richt said:

Perhaps I'm hijacking the thread, but the next question in my mind is about how to migrate from Emby installed under a user profile to the portable install.  Is it as easy as copying the "programdata" folder from the original location to the portable install location? 

Example
  - Created c:\embyserver
  - extract zipped "system" folder to c:\embyserver (c:\embyserver\system)
  - run EmbyServer.exe and allow it to create programdata folder and then exit
  - rename programdata to programdata.clean
  - copy programdata  to c:\embyserver (c:\embyserverprogramdata)

This of course is assuming I know enough about Windows permissions to get around any problems to which @ebr alluded?

So I don't know if it always works this way, but I just copied ALL of the embyserver folder to a new directory. When I installed it went to something like c:\users\embyserver. I copied ALL of embyserver to e:\embyserver, then double clicked the embyserver.exe. That was it. It was already portable even though I installed with setup.exe.

Happy2Play
Posted

It depends on how old your installation is as in the beginning the database did not have tokenized paths.  So if you have a really old install you will run into issues relocating the install.

 

  • Thanks 1
  • 3 months later...
olympus1
Posted (edited)
On 11/22/2021 at 3:27 PM, ebr said:

Hi.  The problem is that the user has to set proper permissions in order for automatic updates to work if we install anywhere other than the user directories.  We had a ton of problems with this in the early days before we moved to these locations by default.  But, as mentioned, if you know what you are doing, you can control this yourself.

Thanks.

I don't think this is an issue.

For example Inno setup can bypass that by giving during installation full permissions to the installed folder.

Well, this is something new Inno does in version 6, its not something that it was always supported.

This is how it does it.

[Dirs]
Name: "{app}"; Permissions: everyone-full;

I could call myself an Inno expert and believe me when I say that this is not an issue for Inno.

I have created a personal installer of jdownloader just to test that, installed in program files folder and it works perfectly.

Inno gives full permisions to the installation folder during installation.

Jdownloader updates the same way Emby does and it needs full permisions in the installed folder or else UAC prompts.

By using an installer like Inno user can have other goodies too, like installing Emby silently.

I don't think it's possible with the current installer to install Emby silently.

Also the current installer has a serious bug. When you uninstall Emby it doesn't delete the registry key of the installation.

This is the key I am talking about, I have tested it many times in VMs, in Windows Sandbox, it's not something that it just doesn't work properly in my current setup.

HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\Emby Server

Edited by olympus1
  • 5 weeks later...
olympus1
Posted
On 11/22/2021 at 3:27 PM, ebr said:

Hi.  The problem is that the user has to set proper permissions in order for automatic updates to work if we install anywhere other than the user directories.  We had a ton of problems with this in the early days before we moved to these locations by default.  But, as mentioned, if you know what you are doing, you can control this yourself.

Thanks.

I would like to add something on this.

Even if you insist to install Emby to a user folder (it can be avoided if the installer gives the proper permisions, I mean with modern installers not the installer Emby still uses from the Mediabrowser days) Emby is not installed to the proper location according to Windows documentation.

Installing a program to AppData folder is just the wrong place to install it, this is the folder for the data of a program not the files of the program.

%LocalAppData%\Programs is the default folder to "install programs for a single user only" in MS Windows.

It's been available since Windows 7/Windows Server 2008 R2 and the proper location to install software per user according to Microsoft documentation for Windows.

  • Agree 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...