Server backup and restore to new partition not working (Ubuntu)

Server Version#: Version 4.46.2

I am doing a test migration of Plex from a partition running Ubuntu 18.04 to a partition running 20.04 (with a view to upgrading once testing is complete).

I followed the backup and restore instructions here, however it is not working. Plex is saying the server is not available.

Is anybody able to help me troubleshoot this please?

Double check permissions.

There are 2 main plex folders, the binaries and the data.

I followed the instructions to do -

chown -R plex:plex /var/lib/plexmediaserver/Library

So everything from the Library folder down is plex:plex.

There is some different ownership in the /var/lib/plexmediaserver folder. I’m not sure what the 998 ownership is and whether that should also be plex:plex. I’m guessing the var folder should remain root:root.

 ls -lah  /var/lib/plexmediaserver/
total 56K
drwxr-xr-x 13  998  998 4.0K Nov 12 11:04  .
drwxr-xr-x 73 root root 4.0K Nov 12 08:55  ..
drwxr-xr-x  3  998  998 4.0K Oct 23 16:21  Codecs
drwxr-xr-x 17  998  998 4.0K Oct 23 16:21 'Crash Reports'
drwxr-xr-x  2  998  998 4.0K Nov 22  2019  Diagnostics
drwxr-xr-x  3 plex plex 4.0K Nov 12 11:04  Library
drwxr-xr-x  3  998  998 4.0K Nov  1 02:03  Logs
drwxr-xr-x  3  998  998 4.0K Sep 22  2014  Media
drwxr-xr-x  4  998  998 4.0K Sep 23  2014  Metadata
drwxr-xr-x  7  998  998 4.0K Sep 22  2014 'Plug-in Support'
-rw-r--r--  1  998  998  838 Nov  1 02:58  Preferences.xml
drwxr-xr-x  2  998  998 4.0K Sep 22  2014  Scanners
drwxr-xr-x  3  998  998 4.0K Nov  8  2015  Thumbnails
drwxr-xr-x  3 root root 4.0K Nov 12 10:16  var

it looks like the tar extraction was flattened.
It also looks like UID 998 came from user plex on another system and this system uses another UID for user plex.

sudo chown -R plex:plex /var/lib/plexmediaserver (sudo is required)

the proper structure under “Plex Media Server” is :

├── Cache
│   ├── OCSP
│   ├── PhotoTranscoder
│   └── Transcode
│       └── Sessions
├── Codecs
├── Crash Reports
├── Diagnostics
├── Logs
│   └── PMS Plugin Logs
├── Media
├── Metadata
└── Plug-in Support
    ├── Caches
    │   ├── com.plexapp.agents.lastfm
    │   ├── com.plexapp.agents.localmedia
    │   ├── com.plexapp.agents.lyricfind
    │   ├── com.plexapp.agents.movieposterdb
    │   ├── com.plexapp.agents.none
    │   ├── com.plexapp.agents.opensubtitles
    │   ├── com.plexapp.agents.plexthememusic
    │   ├── com.plexapp.agents.themoviedb
    │   ├── com.plexapp.agents.thetvdb
    │   ├── com.plexapp.system
    │   ├── org.musicbrainz.agents.music
    │   ├── tv.plex.agents.movie
    │   └── tv.plex.agents.music
    ├── Data
    │   ├── com.plexapp.agents.fanarttv
    │   ├── com.plexapp.agents.htbackdrops
    │   ├── com.plexapp.agents.imdb
    │   ├── com.plexapp.agents.lastfm
    │   ├── com.plexapp.agents.localmedia
    │   ├── com.plexapp.agents.lyricfind
    │   ├── com.plexapp.agents.movieposterdb
    │   ├── com.plexapp.agents.none
    │   ├── com.plexapp.agents.opensubtitles
    │   ├── com.plexapp.agents.plexthememusic
    │   ├── com.plexapp.agents.themoviedb
    │   ├── com.plexapp.agents.thetvdb
    │   ├── com.plexapp.system
    │   ├── org.musicbrainz.agents.music
    │   ├── tv.plex.agents.movie
    │   └── tv.plex.agents.music
    ├── Databases
    ├── Metadata Combination
    └── Preferences

That’s odd. I don’t have a Cache folder, but you don’t have a Library folder. The instructions I linked to tar /var/lib/plexmediaserver/Library on the source, delete /var/lib/plexmediaserver/Library in the target and then unzip the tarball in the target’s /var/lib/plexmediaserver/ folder.

My source (working) system has this structure, which is also slightly different from yours -

ls -lah  /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/
total 60K
drwxr-xr-x 13 plex plex 4.0K Nov 12 12:26  .
drwxr-xr-x  3 plex plex 4.0K Sep 22  2014  ..
drwxr-xr-x  7 plex plex 4.0K Nov 12 11:26  Cache
drwxr-xr-x  3 plex plex 4.0K Oct 23 16:21  Codecs
drwxr-xr-x 18 plex plex 4.0K Nov  7 13:01 'Crash Reports'
drwxr-xr-x  2 plex plex 4.0K Nov 22  2019  Diagnostics
drwxr-xr-x  3 plex plex 4.0K Nov 12 11:25  Logs
drwxr-xr-x  3 plex plex 4.0K Sep 22  2014  Media
drwxr-xr-x  4 plex plex 4.0K Sep 23  2014  Metadata
-rw-r--r--  1 plex plex    4 Nov 12 11:25  plexmediaserver.pid
drwxr-xr-x  6 plex plex 4.0K Dec 15  2018  Plug-ins
drwxr-xr-x  7 plex plex 4.0K Sep 22  2014 'Plug-in Support'
-rw-r--r--  1 plex plex  833 Nov 12 12:26  Preferences.xml
drwxr-xr-x  2 plex plex 4.0K Sep 22  2014  Scanners
drwxr-xr-x  3 plex plex 4.0K Nov  8  2015  Thumbnails

There is nothing in the folders below /var/lib other than the folders listed in the path above. (ie No files and no other folders until you get to the Plex Media Server folder).

My source system also has some of these folders lower down in the tree -

ls -lah  /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/
total 60K
drwxr-xr-x 13 plex plex 4.0K Nov 12 12:26  .
drwxr-xr-x  3 plex plex 4.0K Sep 22  2014  ..
drwxr-xr-x  7 plex plex 4.0K Nov 12 11:26  Cache
drwxr-xr-x  3 plex plex 4.0K Oct 23 16:21  Codecs
drwxr-xr-x 18 plex plex 4.0K Nov  7 13:01 'Crash Reports'
drwxr-xr-x  2 plex plex 4.0K Nov 22  2019  Diagnostics
drwxr-xr-x  3 plex plex 4.0K Nov 12 11:25  Logs
drwxr-xr-x  3 plex plex 4.0K Sep 22  2014  Media
drwxr-xr-x  4 plex plex 4.0K Sep 23  2014  Metadata
-rw-r--r--  1 plex plex    4 Nov 12 11:25  plexmediaserver.pid
drwxr-xr-x  6 plex plex 4.0K Dec 15  2018  Plug-ins
drwxr-xr-x  7 plex plex 4.0K Sep 22  2014 'Plug-in Support'
-rw-r--r--  1 plex plex  833 Nov 12 12:26  Preferences.xml
drwxr-xr-x  2 plex plex 4.0K Sep 22  2014  Scanners
drwxr-xr-x  3 plex plex 4.0K Nov  8  2015  Thumbnails

sorry, accidental clipped

/var/lib/plexmediaserver/
  Library/
    Application Support/
      Plex Media Server/
        Cache/
        Codecs/
        ..
        ..

My concern was this post segment:

total 56K
drwxr-xr-x 13  998  998 4.0K Nov 12 11:04  .
drwxr-xr-x 73 root root 4.0K Nov 12 08:55  ..
drwxr-xr-x  3  998  998 4.0K Oct 23 16:21  Codecs
drwxr-xr-x 17  998  998 4.0K Oct 23 16:21 'Crash Reports'
drwxr-xr-x  2  998  998 4.0K Nov 22  2019  Diagnostics
drwxr-xr-x  3 plex plex 4.0K Nov 12 11:04  Library
drwxr-xr-x  3  998  998 4.0K Nov  1 02:03  Logs
drwxr-xr-x  3  998  998 4.0K Sep 22  2014  Media
drwxr-xr-x  4  998  998 4.0K Sep 23  2014  Metadata
drwxr-xr-x  7  998  998 4.0K Sep 22  2014 'Plug-in Support'
-rw-r--r--  1  998  998  838 Nov  1 02:58  Preferences.xml
drwxr-xr-x  2  998  998 4.0K Sep 22  2014  Scanners
drwxr-xr-x  3  998  998 4.0K Nov  8  2015  Thumbnails
drwxr-xr-x  3 root root 4.0K Nov 12 10:16  var

this clearly shows the tar file was extracted incorrectly and/or in the wrong place.
var looks like /var and Library looks like /var/lib/plexmediaserver/Library (or ./Library)

it looks something like what would happen if --one-top-level were used

Thanks. Something has definitely gone wrong - but I’m not sure how that happened. I untarred Library in /var/lib/plexmediaserver. Library looks like it’s in the right place but the other folders aren’t - and agreed re var looking like /var, which is really odd. I didn’t use --one-top-level. I tarred with cfz and extracted with xf.

I am going to uninstall --purge Plex from the test system, and reinstall. I’ll have a look at the folder structure before extracting, and also try look at the structure in the tarball before extracting.

Got it working. Thanks a lot for the help.

I think the mistake I made was to “tar /var/lib/plexmediaserver/Library”, which resulted in leading /'s being removed.

What worked was to “cd /var/lib/plexmediaserver/” and do “tar ./Library” - which is what the instructions said !

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.