Synology 7 Upgrade - Lost All History

Are you good at reading bash ?

Here’s the logic.

  # No existing DSM 7 installation.  Look for a DSM 6 installation.
  elif [ ! -e "$PlexPkgHome/Plex Media Server" ]; then

    # And if there appears to be a DSM 6-based Plex installation
    # Use first-found directory. "Plex" is default for all DSM 6+ installations.  Users might have moved and used wrong case.

    SourceShare=""
    [ "$(echo /volume[1-9]*/[Pp][Ll][Ee][Xx]]/Library/Application\ Support/Plex\ Media\ Server)" != "/volume[1-9]*/[Pp][Ll][Ee][Xx]/Library/Application Support/Plex Media Server" ] && \
      SourceShare="$(echo /volume[1-9]*/[Pp][Ll][Ee][Xx] | awk '{print $1}')"

    if [ "$SourceShare" != "" ] && [ -d "$SourceShare/Library/Application Support/Plex Media Server" ]; then

      # Test for Plex share access
      if [ "$(synoacltool -get "$SourceShare" | grep "user:PlexMediaServer:allow:rwxpdDaARWcCo:fd--")" = "" ]; then
        MessageText M-ACL-Failure-Plex-Share
        MessageText M-ACL-Procedure
        exit 150
      fi

      # Verify contents are not still in Linux mode but are owned by admin
      if [ "$(synoacltool -get "$SourceShare/Library"                                       | grep Linux)" != "" ] || \
         [ "$(synoacltool -get "$SourceShare/Library/Application Support"                   | grep Linux)" != "" ] || \
         [ "$(synoacltool -get "$SourceShare/Library/Application Support/Plex Media Server" | grep Linux)" != "" ]; then

        MessageText M-ACL-Failure-Plex-Subdirs
        MessageText M-ACL-Procedure
        exit 150
      fi

      # Final check to confirm we have ACL control of subdirectories before continuing.
      Errors=0

      find "$SourceShare/Library/Application Support" -maxdepth 5 -type d | while read Dir
      do
        [ "$(synoacltool -get "$Dir" | grep "user:PlexMediaServer:allow:rwxpdDaARWcCo:fd--")" = "" ] && Errors=$((Errors + 1))
      done

      # If any errors,  do the above again.
      if [ $Errors -gt 0 ]; then

        MessageText M-Cannot-Migrate-ACL-Incomplete
        MessageText M-ACL-Procedure
        exit 150
      fi

      # Perform normal migration of existing Plex server data
      "$ScriptDir/dsm7-migration-tool" "$SourceShare" "$PlexPkgHome"
      [ $? -ne 0 ] && exit $?
    fi
  fi
fi

As I look at that… :man_facepalming: Might have found it.

The permissions of your Plex share might be such that I can’t probe INTO the “Plex” share far enough to see if the contents are a valid Plex server.

That said,

Run the permissions process :slight_smile:

When you are done applying permissions,

Again:

  1. Uninstall Plex
  2. Delete the PlexMediaServer shared folder
  3. Now adjust for maximum :smoking:

I may have written all this but I’m continuing to learn all the different ways it can go wrong thanks to DSM 7.

If what I suspect is true –

It’s a lockout condition. You and the old Plex user can see the files --NOTHING else.

I’ll need to figure out a way around that (early detection somehow) if possible.

PS: I’m retired myself. This was supposed to be my relaxation :rofl: