Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My PlexAppDataDir is not default C:\Users\MyName\Appdata can it be changed in the config? #59

Closed
Wormhole42 opened this issue May 7, 2022 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@Wormhole42
Copy link

Hi, I'm trying to setup a backup to run on occasion with this script. I don't know powershell very well but have been building PC's for 20+ years. This is my like 6th iteration of a my Plex Server and I have a large drivepool setup using Stablebit Drivepool for all my media. I also have a larger 2TB drive that I store my main Plex Media Server folder that I had to mod the registry to point to since my OS is on a 128GB SSD and there's no room for all of the plex database data on it.
So what I've done is switched the location of the Plex Media Server to the N: drive which is not in the drivepool.
The default dir in the script or config file is $env:LOCALAPPDATA\Plex Media Server and I want to change this so it will point to N:\Local\Plex Media Server\Plug-in Support\Databases
Can this be done? Or should I just upgrade my OS drive to a larger 1TB SSD?
Right now I'm having to restore my databases to an earlier backup from last Oct since I had a system crash and it corrupted the database file.
I also have scheduled tasks to do a backup every 3 days but for some reason it never does and that's why I'm having to redo all my metadata that's changed or updated since Oct last year. I've done so much work manually making my plex media look how I want it and now I have to redo it. So I thought setting up this script would help me automate those tasks so I don't lose anything like this again. It's such a pain. lol
Thank you for creating this script to begin with I'm sure once I get it setup and running I will be reasonably worry free.
Cheers!

@alekdavis
Copy link
Owner

alekdavis commented May 7, 2022

Hmmm... I'm not sure what you meant by:

The default dir in the script or config file is $env:LOCALAPPDATA\Plex Media Server and I want to change this so it will point to N:\Local\Plex Media Server\Plug-in Support\Databases

Normally, Plex Media Server\Plug-in Support\Databases is a subfolder under the Plex Media Server app data directory. Generally, yes, you can overwrite the default via the PlexAppDataDir parameter (command line or config file), but again, I'm not sure what you're trying to do here. If you said that your Plex app data dir is somewhere else, like N:\Local\Plex Media Server, then it would make more sense. But regardless, in the long term, I'd upgrade the hard drive to something like 256GB, which should be enough for most. It would save you headaches in future (and SSDs are not expensive these days).

@alekdavis alekdavis self-assigned this May 7, 2022
@alekdavis alekdavis added the question Further information is requested label May 7, 2022
@Wormhole42
Copy link
Author

Yes that's exactly it. My Plex server media dir is in N:\Local\Plex Media Server and not in $env:LOCALAPPDATA\Plex Media Server as it says in the script of the config file you created. I had to edit the registry for Plex to point to that dir due to storage constraints.
So if I wanted to change $env:LOCALAPPDATA\Plex Media Server to point instead to N:\Local\Plex Media Server, how would I do that? Is that even possible?
In the meantime I will consider getting a bigger SSD for my OS but it will be a pain to reinstall Windows and the Stablebit Drivepool software that needs to be deactivated and reactivated on the new install because of the software license. Once I do get it reinstalled it shouldn't be too difficult to get the drivepool set back up. It will find all of the drives in the pool and remeasure the data but I would want to still at least backup the databases to another drive.
Thank you for answering so quickly. It's much appreciated.

@alekdavis
Copy link
Owner

alekdavis commented May 7, 2022

Just specify path to your custom directory via the PlexAppDataDir parameter, like

.\PlexBackup.ps1 -PlexAppDataDir "N:\Local\Plex Media Server" ...

Should be simple.

@Wormhole42
Copy link
Author

Ok I will try that. I'm running a manual backup right now of the whole Plex Media Server to an external hard drive. I started it last night and it's over 100GB so it's going to take a long time. Once it's done I'll try to modify the config as you suggested and see if it'll compress it and make the backup smaller. I will let you know. Thanks

@Wormhole42
Copy link
Author

Will I replace the whole line as you suggested as such?
This is your script
},
"PlexAppDataDir": {
"_meta": {
"default": "$env:LOCALAPPDATA\Plex Media Server"

So I will make it look like this?
},
"PlexAppDataDir": {
"_meta": {
"default": "N:\Local\Plex Media Server"

I tried that initially but it didn't work, but I will try again once this manual backup finishes.
Thanks

@alekdavis
Copy link
Owner

alekdavis commented May 9, 2022

"PlexAppDataDir": {
    "_meta": {
        "default": "$env:LOCALAPPDATA\\Plex Media Server"
    },
    "value": "N:\\Local\\Plex Media Server"
},

@Wormhole42
Copy link
Author

Wormhole42 commented May 9, 2022

Oh okay. Thanks!
My manual backup took for freaking ever.
So I went ahead and got a 1TB SSD and reinstalled everything. Now I'm in the process of moving the stuff from N: Plex to the default in the users appdata. Hopefully once it's all done moving I'll be able to run your script the way it's supposed to be to another new 1TB SSD I have coming and can just continue to make backups to it in the future. Migrating data takes way too long and this is very annoying. Hopefully when it's all done my server will not need much maintenance in the future.
I appreciate your help though! Thanks so much for your input/help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants