Jump to content

CLI to Selectively Restore Appdata Folder from CA-Appdata .TAR?


Recommended Posts

I've been having a hell of a time trying to get my Plex installation fixed, after almost certainly corrupting the database, possibly by accidentally filling the cache SSD where appdata also lives.

 

I've had some help already (from @trurl , @TexasUnraid, and @Energen), first in the linuxserver.io Plex Docker forum, and then in the binhex Krusader forum, but I think what I'm doing now isn't related to those Dockers, specifically.

 

I think I want to do the following, and need help:

1. Delete the existing, non-working data from the appdata/Plex folder, which by now must be a mess of overlapping half-assed recovery attempts. (I've tried restoring a couple of times, and can get Plex running, but either it says it can't find my server, or assumes I'm starting from scratch.)

2. Restore just the Plex data from a recent CA Backup .tar file...

2a. ...preferably directly to the now-empty appdata/Plex folder.

3. Make sure all the newly-restored data has the correct permissions (rwx) so the Docker can use it properly. (I manually extracted the folder using the CLI/console, but copied it to a new directory under appdata using Krusader, and it arrived with permissions as 'r–x'.)

4. Make sure that the Docker is looking at the correct location (/mnt/user/appdata/Plex or /mnt/cache/appdata/Plex, whichever it's supposed to be).

 

@Energen sorted out Step 2 (quoted below), but I'd appreciate some help with Steps 1, 2a, 3, and 4... please. 

 

Quote

 

...extract manually from a console window.  It's just like working on a Windows command line.

 

cd /mnt/user/appdata/backups  --- or wherever your backup file is

tar -xvf CA_backup.tar <name of folder> --- this will extract only the folder you want.. it's case sensitive (as is everything in linux) so Plex and plex would be two different folders.  It's got to be exactly what the name of your folder is.

 

This will extract it in the same directory as your backup file.

 

 

  • Like 1
Link to comment

Oh man.. where to start...

 

23 hours ago, Karyudo said:

1. Delete the existing, non-working data from the appdata/Plex folder

Go to a console window, and "cd /mnt/user/appdata/"  then "rm -r Plex" or whatever your Plex folder is named.

 

That will delete the directory... good bye.

 

Quote

 


2. Restore just the Plex data from a recent CA Backup .tar file...

2a. ...preferably directly to the now-empty appdata/Plex folder.
 

 

 

Using the same type of command, should be something like "tar -xvf -C /mnt/user/appdata/Plex CA_backup.tar <name of folder>"

It would be less error prone to copy the backup file to appdata first and then use the first command on it there.

 

Quote

3. Make sure all the newly-restored data has the correct permissions (rwx) so the Docker can use it properly. (I manually extracted the folder using the CLI/console, but copied it to a new directory under appdata using Krusader, and it arrived with permissions as 'r–x'.)

 

I believe this is what the Docker Safe New Perms option is for in the unraid gui on the tools screen.  It's supposed to reset all permissions.

Alternatively you can manually do it from a console window.  "chmod -R 777 /mnt/user/appdata/Plex"

 

Quote

4. Make sure that the Docker is looking at the correct location (/mnt/user/appdata/Plex or /mnt/cache/appdata/Plex, whichever it's supposed to be).

 

Your Plex docker configuration should have /config pointed to the correct location.

/config : /mnt/user/appdata/Plex

 

Whether or not it's on the cache drive is determined by your appdata share settings.

 

You should probably just forget about your backup files and let Plex rebuild everything for you.... you've done a real head slapper on all of these files :P

 

Edited by Energen
Link to comment
10 minutes ago, Energen said:

Now it's back... am I crazy?! I was quite tired when I thought I hit submit.... lol... was it stuck in the void somewhere? I'm just going nuts now.

When I first looked, I didn't see your help post, and only saw your "it's gone" post. The next time I looked, it was there, before the "it's gone" post. So you're not nuts!

 

My favourite tangentially-related quote from Jerry Seinfeld (as related by Penn Jillette) is, "All magic is, 'Here’s a quarter, now it’s gone. You’re a jerk. Now it’s back. You’re an idiot. Show’s over.'"

 

(BTW, I'm on Step 2 (and hopefully 2a) of the procedure above.) 

Edited by Karyudo
Link to comment

Ha! For the purposes of this thread, I will assume the role of both jerk and idiot.

 

EDIT: Good news! I believe I have successfully restored my Plex installation from my August 3 backup. Looks fine with the WebUI; Tautulli says "nothing being played"; I can play files. The 'activity' icon is circling, which worries me just a bit, and I got a 'server unreachable' message for a brief time, but I imagine it's churning its way through over a week of new media...?

Edited by Karyudo
Link to comment
On 8/10/2020 at 8:53 PM, Energen said:

I believe this is what the Docker Safe New Perms option is for in the unraid gui on the tools screen.  It's supposed to reset all permissions.

Alternatively you can manually do it from a console window.  "chmod -R 777 /mnt/user/appdata/Plex"

God no.  What docker safe new perms does is specifically exclude appdata from any changes to permissions / ownership.  Docker containers may have their own unique and specific ownership / permission requirements, and messing around with them may impact your ability to run those applications (or have undesired side effects)

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...