Synology FAQ - Questions, Answers, and How-To's

FAQ 18: Moving PMS from Mac/Windows to Synology

Note: This method mimmicks the “DSM 7 ‘migration’”. It is done this way to maximize automation and ensure a successful import.

  1. Make certain to turn off / disable the following in Plex Settings > Server > Library before stopping PMS.
    a. Scan my library automatically
    b. Run a partial scan when changes are detected
    c. Scan my library periodically
    d. Empty trash automatically after every scan

  2. Stop PMS on the source (Mac/Windows) machine

  3. ZIP up the “Plex Media Server” directory.

  4. Using FAQ #1, give yourself access to the Plex Share

  5. If PMS is already running on the Syno, stop it. If not installed, Install it and then stop it.

  6. Open File station

  7. Navigate to Plex / Library / Application Support

  8. Rename the existing “Plex Media Server” directory to “PMS.orig”

  9. Drop your ZIP file and unzip so it unzips and takes its place as “Plex Media Server”

  10. Right-click “Plex Media Server” and set the properties - owner as “plex:users” for “this folder, sub-folders, and files” (checkbox)

  11. Using File Station
    a. Navigate to Plex/Library/Application Support/Plex Media Server/
    b. Delete everything found here. These tokens are incompatible with Linux. New will be created as needed without issue.
    c. Details / How-To in this FAQ Synology FAQ - Questions, Answers, and a few How-To's - #27 by ChuckPa

  12. Start PMS.

  13. Now transfer the media locations (Edit each Media Library section in turn:
    a. Add the new locations,
    b. scan files
    c. observe duplicates showing (good),
    d. when all duplicated
    e. Edit the section’s folders again and remove the original locations.
    f. Advance to the next Library section and repeat until done.

  14. When all sections have been edited,
    a. Scan files one final time
    b. Empty Trash
    c. Clean Bundles
    d. Optimize database

  15. When happy everything has transferred, delete the ZIP file.

Go to Index

2 Likes

FAQ 19: Setting permissions to allow Plex access to media files

Before beginning, it’s important to remember one key point; Plex doesn’t have any special privileges on Synology except for being able to access the Video Transcoding acceleration hardware. It cannot read any of your files unless you expressly grant permission. This is a fundamental principle of Linux (which Synology uses for DSM)

Because of how Synology grants permission, access to files is broken into two different elements and, as the direct result, may take 3 forms

  1. The file(s) were copied onto the NAS from external media
  2. The file(s) were copied onto the NAS using a SMB/NFS user account
  3. The file(s) were copied onto the NAS using a third party utility/program.

In almost all cases, granting access to user Plex in the Control Panel - Shared Folders (app) is all that’s needed. However, sometimes, because of the different ways media files might have been copied, they need permission adjustments to work in the Synology/Plex environment.

This FAQ shows the different steps you might have to take to change permissions for Plex to see the media.

For DSM 7 - Grant permissions for “PlexMediaServer”
For DSM 6 - Grant permissions for “Plex”

  • The most common, which is also a required step, and easiest to do, is grant access to the Shared Folder where the media is being stored. Always do this step first.
    a. Control Panel
    b. Shared Folders
    c. EDIT the share containing the media
    d. Permissions tab
    e. Check the box (Read only or R/W) to grant Plex access.

  • The second most common, but also most confusing, is when permissions are mixed due to where the media files originated. Only do this step as needed and only to the degree it’s needed.

(DSM 6 shown here. Use PlexMediaServer for DSM 7)

  1. Check the share’s (or movie/tv series’) Properties

  2. If user “Plex”/“PlexMediaServer” isn’t listed, we will need to add it to the list of username (top box), and then check the access permission boxes (Read permissions block & Write permissions block)

  3. After adding user Plex to the list, to complete the operation, “Apply to this folder, sub-folders, and files” then click OK.

Final note:

It is possible, as you add media, you will again encounter individual files which aren’t seen. By applying the last part of this procedure surgically on those folders/files, you can open up their permissions and allow Plex to see them.

Ref: PlexMediaServer - DSM 7 permissions

Go to Index

2 Likes

FAQ 20: Bypassing the iHD video driver

Obsolete as of PMS version 1.21.0

Reference only

This still seems to be effective for some customers with low bitrates, LiveTV buffering, or DVR signal strength issues

For versions below 1.21.0
This shouldn’t be necessary but is until such time as Intel is able to fix the problem.
the best choice is to configure PMS to bypass it by editing your Preferences.xml file

  1. Install the Synology Text Editor (Required)
  2. Stop Plex
  3. Open File Station and navigate to Plex / Library / Application Support / Plex Media Server
  4. Right-click Preferences.xml and Open in Text Editor
  5. On the bottom line, scroll to the right.
  6. Bfore the closing /> type VaapiDriver="i965" .

It will appear as : VaapiDriver="i965" />
Preceding and succeeding space is required.

  1. Save the file
  2. Restart PMS

WARNING: REMOVE this preference when playing HEVC HDR encoded with Level 5.0 and above. The i965 initialization will fail. HW transcoding will fall back to SW and fail to transcode.

Go to Index

3 Likes

FAQ 21: After migrating from Windows to Synology

After moving (ZIP file – which can take a long time due to the number of files being moved) your Plex server from a Windows platform to any Linux platform, you must remove all the leftover Windows files which are known to cause problems.

The two important areas to purge are:

  1. Plex / Library / Application Support / Plug-in Support / Caches

  2. Plex / Library / Application Support / Plug-in Support / Data


    Do not purge Databases (this is your main database)

After purging the caches (removes all the files with CR/LF text files)

  1. Start Plex.
  2. For each Library section
    a. Scan Files
    b. Refresh All Metadata
    c. All to complete before advancing to the next section.

Go to Index

1 Like

FAQ 22 - Hard reset server credentials.

DSM 7 -

  1. Uninstall with the “Keep” option

  2. Install the same version package again,
    – Plex Claim Token method
    – Click “Get Plex Claim token”
    – Browser will open and show claim-xxxx token
    – COPY the token to browser (do not waste time. Token expires in 5 minutes)
    – Return to installer window
    – PASTE into token window on installer form


    – Click NEXT & DONE and continue installation
    – Installation will take 15-30 seconds longer as installer and Plex.tv setup new credentials
    – Installer will show success or failure. Success will confirm using your Plex account username when done.

  3. This ONE TIME -
    – Open an incognito window
    – Open http://lan.ip.of.syno:32400/web
    – IGNORE the “not hosted by Plex” message and proceed.
    – Sign in
    – Go to the left panel and select your server
    – Let the browser and server resync

  4. You may now close the browser tab and use PMS normally.

  5. Restart any player devices so they update with the new server credentials.

DSM 6 -

Use this procedure (Soft reset) when:

  1. You receive the nasty “No Soup For You” message
  2. You’ve changed your Plex password and now have trouble accessing the server.

WARNING
If you can use SSH-tunnel, use it. Do not use VPN. Use of a VPN forwards your IP as the “Referrer-IP” which PMS will always detect as remote which locks you out when it’s unsecure.

Soft Reset credentials.

Begin here:

  1. Sign out the plex/web browser
  2. Open a new Window
  3. Go to to www.plex.tv (not app.plex.tv)
  4. Sign into your account settings.
  5. Force sign out everything as you change the password.
  6. Open an incognito window
  7. Open http://ip.addr.of.host:32400/web (or 127.0.0.1:32400/web if on the host)
  8. Sign in
  9. Claim it again.

The X-Plex-Token and other credentials will now all resync
go to your devices and sign them in again.

If the soft reset step fails

Hard reset credentials.

  1. Stop PMS

  2. Using File Station, navigate to “Plex / Library / Application Support / Plex Media Server”

  3. Right-click ‘Preferences.xml’ → Open with Text Editor
    (Install the text editor in Package Center if needed)

  4. There are 4 values to remove. The are all of the form Name="Value"

  5. Remove the Name="Value" pairs for:

  • PlexOnlineUsername
  • PlexOnlineToken
  • PlexOnlineMail
  • PlexOnlineHome (if it exists)
  1. Save the file

  2. Start PMS

  3. In an INCOGNITO brower tab, open http://lan.ip.of.syno:32400/web

  4. It will want you to sign in – Do so

  5. It might offer “Got It” . OK if so offered

  6. Might offer the setup wizard.. Skip through it as appropriate
    ( No need to recreate shared folders unless you deleted the contents of the Plex shared folder)

  7. When you arrive at the Dashboard, recheck your settings. All should be intact.
    Fix as appropriate.

  8. You may now use PMS normally.
    Go to Index

2 Likes

FAQ 23: Moving large amounts of data on Synology via GUI.

This FAQ is intended to be used in conjunction with this How-To

This FAQ is to help you get away from using the default Synology Video, Music, and Movie shares. Use of their shares will always conflict with Plex when Video station and/or Audio Station is installed. This FAQ helps you store your media in a neutral location both can work with.

This FAQ is provided AS-IS, without liability for any data loss (I hate legal clauses but necessary) so be sure you know what you’re doing as it is a “Full Power” tool.

While it does seem like a lot of work, it is only in the first-time setup.

This procedure is set to move ONE block of data at a time. If you need to move multiple blocks around, you will need run it multiple times. Keeping it this simplistic avoid mass damage from occurring.

When moving large quantities of items, you’ll quickly find File Station takes far longer “preparing” than you do to make the edits.
WARNING:

Before proceeding:

  1. If the source volume and the destination volume are different, make absolutely certain you have enough free space on the destination volume.

  2. If you are moving to a new share, be certain to create the new share in Control Panel - Shared Folders first. Pay attention to the capitalization you use.

  3. If source and destination volumes are the same, there are no disk space concerns.
    a. If moving across volumes, you will need to make certain enough space exists on the new destination volume. ( This process does a copy-then-delete after method )

  4. Make 100% certain there are no folder or file names which begin with a period (DOT) . character. The dot character (period) in Linux is considered a hidden folder or file and will be ignored (left behind).

How To Do This:

  1. Control Panel

  2. Task Scheduler

  3. Create a scheduled task which is a User-defined Script

  4. It is to run as user root . DO NOT “Enable” it.

  5. Define it to run on the schedule below (which satisfied the GUI only)

  6. Under “Settings” copy and paste this text VERBATIM

#!/bin/sh
#
# Define the source and destination share names (Capital letters are critical)
Source="/volume1/ChuckSource-Test"
Destination="/volume1/ChuckDestination-Test"
#
# It is important that the Destination exist before Enabling and Running this script
# If not created,  the script will error.

# Check before moving
if [ ! -d "$Source" ]; then
  echo \"$Source\" is not a directory or does not exist.
  exit 1
fi
if [ ! -d "$Destination" ]; then
  echo \"$Destination\" is not a directory or does not exist.
  exit 1
fi

# Safe to move so do it.
mv -f "$Source"/* "$Destination"


  1. If you want the script output emailed to you, enter your email address
  2. When complete, click “OK” to save it.

The script is now ready to edit for your use.

How To Use
In Plex:

  1. Go to the Library section
  2. Add the new shared folder (Destination) to the list of monitored folders)
  3. Save it
  4. Let it scan but come up empty
  5. Go to Settings - Server - Library
    a. Disable Automatic Scan
    b. Disable “Empty Trash after every scan”
  6. Now perform the move below

Performing the move

  1. In the Control Panel - Schedule Tasks
  2. Highlight the script and click “EDIT”
  3. Go to “Settings”
  4. Carefully edit the source and destination directory (folder) names to match your source and new destination shared folders.
  5. Save (OK) the changes
  6. Advise: Open FileStation so you can monitor the progress (use Refresh)
  7. Now “RUN” the script.

  1. After it’s done, inspect

–Before–

–After–

  1. Return to Plex
  2. Go to the Library section you are moving the data for.
  3. Invoke a “Scan Files”
  4. Observe as Plex finds the files in their new location (did you give Plex permission?)
  5. When all media is accounted for (no red trash can), EDIT the shared folder list again and remove the old media location.
  6. Scan again

You’re nearly done.

  1. When all media moves have been completed
  2. Settings - Server - Library
  3. Enable Scan my library automatically (if you disabled it)
  4. Enable “Empty Trash” again
  5. Lastly perform these steps to clean the whole library section
    a. Scan Files
    b . Empty Trash
    c. Clean Bundles
    d. Optimize Database

Go to Index

FAQ 24: Restoring Share Permissions to Default Settings

DSM 6 only

This FAQ/How-To is for those cases when the different applications in use on a Synology NAS have interfered with PMS operations so much that trying to sort out the root cause has become impossible.

It is in these cases, the best solution is to forcibly set them to a known base permission level.

Here is how to do it.

  1. Control Panel - Scheduled Tasks
  2. Create a “User defined Script”
  3. DO NOT “enable” it (It is enabled by default). You want full manual control.
  4. In the Task Settings tab, paste the script below (copy/paste from the browser) exactly as I have provided
  5. Save (OK) it.
  6. Now “Edit” it again → Task Settings.
  7. Edit the line: for D in "/volume1/Animated", replacing my share pathnames with your pathnames. Multiple quoted paths may be listed on that line, separated by a space. The names are case-sensitive so please to be exact.
  8. The script runs silently but you can opt to have it email you the output (in the other settings).
  9. When happy with your edits, Save it again (OK).
  10. The task is now ready to execute.
  11. Run the task.
  12. Review and re-add permissions to the share(s) using Control Panel - Shared Folders.

It is advised Operate on one share at a time until you are certain you understand what follow-on steps are needed.

After running the script, any special permissions which were previously granted to the listed shares will have been removed.

The default permissions assigned are:

  1. The share owner (you?) will have full Read/Write access
  2. Everyone else will have Read-Only.
  3. Shared Folders or File Station can now be used to add/remove permissions as you deem appropriate.

A. Preparation of the script - Creating

B. Pasting in the actual script from below +

C. Running the script to set the permissions.

The “Script” for Task Settings

#
# This script will reset and assert permissions in the each of the listed directories
# in this "for" loop.   DO NOT assert permissions on any Synology/system-reserved folders.   This could render your data inaccessible.

# Which shares are we going to work on
for D in "/volume1/Animated" 
do

 # Do this only if the name ($D) is a directory (full folder path)
 if [ -d "$D" ]; then

  # Revoke all previous permissions to a sane value
  find "$D" -type d -exec chmod 755 {} \;
  find "$D" -type f -exec chmod 644 {} \;

  # Now assert Synology ACLs so the current file owner has control
  find "$D" -type d -exec synoacltool -add {} 'owner:*:allow:rwxpdDaAaRWcCo:fd--' \;

  # Grant Read-only to everyone else
  find "$D" -type d -exec synoacltool -add {} 'everyone:*:allow:r-x------R-c-o:fd--' \;

 fi
done

Ask if questions prior to use.

Go to Index

FAQ 25: Reclaiming a lost server

This How-To is better than the :exploding_head: nuclear option of starting over.

DSM 7

To reclaim a “lost” server. (lost / locked out / password reset)

  1. Uninstall the package with the “KEEP” option.
  2. Reinstall the same package again, selecting the “Plex Claim Token” option
  1. Click NEXT, NEXT, and DONE to continue installing.

  2. After about 15 extra seconds, The installer will confirm you’ve installed the package again AND whether or not it is reattached. When reattached, it will show your Plex username.

  3. Open a private browsing window to the LAN IP of the Syno ( http://lan.ip.of.syno:32400/web )

  4. Sign in, ignore the “Not Hosted by Plex” warning. Confirm everything is back.

  5. Close this window and reopen normally. Claiming is complete.

DSM 6

This is written this for worst case (reclaiming may happen 2 ways - both are shown here). It will likely only need through step 16 but I’ve provided everything just in case.

  1. Install the Synology Text Editor app (in Package Center - Search)
  2. Stop Plex
  3. In your web browser, https://app.plex.tv
  4. Settings - Authorized Devices - Servers (drop down)
  5. Remove the Synology (we will make it appear again in a minute)
  6. Sign out of Plex/web (upper right corner)
  7. Open File Station
  8. Plex share / Library / Application Support / Plex Media Server
  9. Right - click “Preferences.xml” → Open in Text editor.
  10. Very carefully, remove the complete Name="Value" pairs,
    a. PlexOnlineToken="-value-"
    b. PlexOnlineUsername="-value-"
    c. PlexOnlineMail="-value-"
    d. PlexOnlineHome="value"
  11. Save the file.
  12. Right-click Preferences.xml again and make certain it is still owned by plex
  13. Start Plex
  14. Back in your browser - Open an Incognito window
  15. Open http://ip.addr.of.syno:32400/web
  16. It will ask you to sign in again
  • In case it thinks “We’ve found a new server”, continue with step 17 below.
  1. Expect the “Got It” message and “We Found a new server”.
  2. The setup wizard is also likely to start. We will SKIP through this.
  3. Do not create any new library sections. All your existing media still is there.
  4. Continue forward until you FINISH and get to the dashboard.
  5. You’re done.

Go to Index

4 Likes

FAQ 26 - Migrate from another OS → DSM 7

Migrating from another PMS installaton to Synology DSM 7 requires a little bit of up-front work.

The basic procedure is:

  1. Prepare the existing installation for copying
  2. Create a “Plex” shared folder on DSM which will be the base share for importing.
  3. Create the folders “Plex/Library/Application Support”
  4. Copy the “Plex Media Server” folder and contents into “Application Support”
  5. Manually set permissions of the Plex share, and all files in the shared folder, so it can be read by everyone (which also will include the new PlexMediaServer user when it gets created).
  6. Now we will “Manual Install” Plex (DSM7) on the NAS.
  7. As it installs, it will issue some initial errors because the permissions are not correct.
  8. Follow the instructions given in the pop-up message.
  9. When the installer is satisfied, it will begin “Installing” and sit there.
  10. Let the DSM 7 installer do the heavy-lifting . (It will give instructions as it does its work)
  11. You’ll know when it’s done. Plex/Migration.log will indicate “Cleaning” is complete.

Here we go :grinning_face_with_smiling_eyes:

On the originating host PMS

  1. Turn off all automatic updating
  2. Disable “Empty Trash”
  3. Save those settings
  4. Stop Plex
    (we’re about to clone it)
  5. Create a ZIP file of the “Plex Media Server” folder (the one that contains all the metadata underneath it)

On DSM

  1. Create a shared folder named Plex (case sensitive)
  2. In that shared folder, create this structure (old DSM 6 'cuz it’s easiest)
Plex/
  Library/
    Application Support/
  1. Copy the ZIP file to the “Plex/Library/Application Support” folder

  2. Unzip the ZIP

  3. After unzipping move the contents if needed to produce the following structure

Plex/
  Library/
    Application Support/
      Plex Media Server     <-- this will have come from originating machine
  1. Download PlexMediaServer from https://plex.tv/downloads for your Syno

  2. Manual install that SPK file

  3. As it installs, it will find the “Plex” shared folder and immediately (while installing) start migrating it to the DSM 7 structure.

  • Do not be alarmed if DSM gives you an error (Operation Failed and forces you to sign out).
  • The installer will keep running until it’s completed.
  • The installer will tell you if there is a failure (Popup message window)
  1. Depending on how much data you have, you might be here a few minutes → hours → whenever.
  • DO NOT INTERRUPT OR RESTART DSM. You will invalidate the installation migration.
  1. Open a new window to the Synology, Open the Plex share. Look at the file “Migration.log” . You’ll be able to follow the progress

In case you need to see the steps about granting permissions.

1 Like

FAQ 27 - Migrating an existing PMS from DSM 6 to DSM 7


NOTICE: DSM 5 → [ DSM 6 ] → DSM 7 First Step

If you first started using Plex with DSM 5, then upgraded to DSM 6, because of a change internal to DSM 6, you will need to perform this step before you start the DSM 7 upgrade.

If you never used DSM 5, or deleted the Plex share sometime during DSM 6, you can skip this step and continue with the normal upgrade steps

  1. Rename the existing Plex shared folder to Plex.old
  2. Create a new Plex shared folder
  3. Move the entire contents of Plex.oldPlex
    What you’ve done creates a shared folder which DSM 6 didn’t upgrade.
    DSM 5 didn’t support “Full Control” mode. DSM 6 introduced this.
    With DSM 7, we need Full Control mode for the Plex share due to the added restrictions of DSM 7.

Upgrading PMS from DSM 6 → DSM 7

DSM 7 no longer allows us to go find the metadata directory and use it across volumes before starting PMS (This is the lack of “root” privilege blocking). As such we require the following two conditions are met we will attempt to automatically migrate you;

  1. You have an existing DSM 6-created PMS installation and PMS is installed on the SAME STORAGE VOLUME as the “Plex” shared folder (this is critical)

  2. You have an existing DSM 6-created installation and PMS is uninstalled and reinstalled on the same volume as the existing Plex share.

If you do not meet either of the above conditions we will warn you and advise you.

Scenario 1: Plex Media Server is NOT installed on the same volume as Plex share

  1. If PMS is installed on a volume other than the Plex share’s volume, you will be notified to make your system comply with the new requirements.

  1. At this point, Uninstall the failed package

  1. When re-installing, instruct Package Center to install PMS on the same storage volume as the Plex share. (Check this in Control Panel - Shared Folders if uncertain).

  2. You can now proceed to the next section of instructions in Scenario 2.

Scenario 2: Plex Media Server installed on the same volume as the Plex share

  1. If PMS is installed on the same volume as the Plex share we will detect this and attempt to automatically migrate your Plex Media Server library/preferences to the new DSM7 location.

  2. Migration Bootstrap (This failure is expected during during first installation)

When you first install Plex, because the username and permissions mechanism have changed in DSM 7 to PlexMediaServer, DSM won’t have the proper privileges set. You will need to assign them.

  1. During install / upgrade, it will fail and give you this message:

  1. Change the shared folder permissions using
    a. Open Control Panel
    b. Shared Folders
    c. EDIT the Plex share
    d. Permissions tab
    e. Click Customize
    f. Check all Administration
    g. Check all Read
    h. Check all Write
    i. Click Done
    j. Check ‘Apply to this folder, sub-folders, and files’.
    j. Click Save (Applies shared folder permission changes)
    k. – Now wait until all changes are applied
    l. Click Save again to return to the Shared Folders app.

NOTE: “PlexMediaServer” must have Full Control. Repeat the steps above until DSM shows Full Control for user PlexMediaServer.

  1. Propagate this change throughout the shared folder
    a. Check Apply to this folder, sub-folders, and files (Important)
    b. Click OK
    c. Wait for permissions to be applied to all the files. (2 minutes/1000 items)

Here is a screen capture with everything open and all boxes checked.

When DSM returns to the Shared Folders app, Phase 1 is complete.

You may now continue with Stage 2

Stage 2

  1. Uninstall the failed PMS package..and Install again.
    a. If you attempted Repair, and PMS shows installed, use Remove all data option.

  1. PMS will again check all permissions are in order.

  2. If they are not. you will be instructed to contact us here in the forums for additional support. Otherwise, you will see Installing while all permissions are changed, symbolic links are checked, and your data moved to the new storage location.

  3. If the installer finds no issues with ownership or permissions, it will begin actual migration. The protracted “Installing” spinner is the actual migration in progress.

  1. Migration is not instantaneous. AFTER a significant delay (about 1 minute per 1000 items indexed by Plex) you will now see the final message telling you that your Plex installation has been migrated to DSM 7 and what you still need to do to grant access to your media.

Alternative installation using Claim Token ( Docker container style )

This method supports claiming a server which is:

  1. Remote
  2. On a non-RFC 1918 network
  3. Credentials compromised due to hard server reset or password changed incorrectly.

To use:

  1. Select the option
  2. Click “Get Claim Token”
  3. Authenticate with Plex.tv
  4. Copy the token string
  5. Return to the installer,
  6. Paste the token string into the window
  7. Click Next

(the token is valid for 5 minutes so do not delay)

NOTES:

The migration requires about 1 minute for every 1000 items indexed by Plex.

During this time, we:

a. Correct all malformed agent entries from older PMS versions
b. Assign all new permissions for user PlexMediaServer

Upon completion,

  1. Your Plex Media Server files will have been relocated to the new storage area.

  2. All other Plex-created information files and directories created by Plex in the Plex share will be removed if possible.

  3. There is no risk to any media you may be storing in the Plex shared folder.

1 Like

28. Using Docker for HW trancode & Tone Mapping - How To

WARNING:

This technique is no longer required as of PMS 1.29.1.6240.

PMS 1.29.1.6240 and above installs the needed drivers automatically upon first use

You may now remove the PMS container and image.

=================================================================

OBSOLETE

This How-To (FAQ) will demonstrate how to setup PMS, with HW transcoding and tonemapping support.

Two different methods are presented here
– First method is run via Scheduled Tasks which creates the Tone Mapping configuration
– Second method is for those NAS platforms (ARM based) which do not have HW transcoding capability.

Prerequisite - Get the PlexMediaServer UID/GID information

Get the UID/GID values from DSM 7 for use with PLEX_UID & PLEX_GID

  1. Create a Scheduled Task - User script
  • Run once
  • Email you the output
  • username admin is fine.

Screenshot from 2021-12-14 12-17-17

  1. In the email, you’ll see lines which looks like this:
chuck@ds418:~$ id PlexMediaServer
uid=297536(PlexMediaServer) gid=297536(PlexMediaServer) groups=297536(PlexMediaServer),937(videodriver)
chuck@ds418:~$ 
  1. The first number (297536) is the value for PLEX_UID or PUID.
  2. The second number (297536) is the value for PLEX_GID or PGID.
  3. The numbers shown here may not match your system. Use only those which come from your system only.

Method 1 - Hardware Transcoding + Tone Mapping

  1. A pms-docker container
  2. Which uses the DSM 7 (/PlexMediaServer/AppData structure) shared folders.
  3. And is fully interoperative & non-destructive of the Native app. (you can run either either as you wish.)

A. Create the HW transcoding container

  1. Create a Scheduled Task , User-Script, run as root which creates the new container. Again, have it email you the results to confirm successful creation.

  2. Substitute your actual values in the environment variables where appropriate.

Use “ID” and “GID” pulled from your system PLEX_UID & PLEX_GID
(You may use PUID & PGID for if you wish)

  • Task “Settings” are:
    – Change /volume1/PlexMediaserver to the appropriate volume only if your PlexMediaServer shared folder isn’t on the default /volume1
docker run \
-d \
--name Plex \
--network=host \
-e TZ="EST" \
-e LANG="en_US.UTF-8" \
-e PUID=297536 \
-e PGID=297536 \
-e PLEX_UID=297536 \
-e PLEX_GID=297536 \
-h dockerplex \
-v /volume1/PlexMediaServer/AppData:"/config/Library/Application Support" \
-v /volume1/PlexMediaServer/AppData/tmp:/tmp \
-v /volume1/PlexMediaServer/AppData/tmp:/transcode \
-v /volume1:/volume1 \
-v /volume2:/volume2 \
--device=/dev/dri:/dev/dri \
plexinc/pms-docker:plexpass

# Set to automatically restart unless stopped
docker update --restart=unless-stopped Plex

B. Run the task to create the container

  1. Run the scheduled task
  2. Check your email to confirm success
  3. Open the Docker app and verify you now have a Docker container.

===========================

Method 2 - Create your new container (ARM processors - No HW transcoding)

A. Define the container in the Docker GUI

  1. Download the pms-inc image
  2. Create the container using these specific settings
  • Volume map: /PlexMediaServer/AppData/config/Library/Application Support

  • Volume map: /PlexMediaServer/AppData/tmp/transcode
    Screenshot from 2021-08-18 22-45-18

  • Environment variable: PLEX_UID and/or PUID = value we obtained above

  • Envirohttps://forums.plex.tv/t/important-information-about-plex-for-smart-tvs-after-september-30-2021/746506nment variable: PLEX_GID and/or PGID = value we obtained above

  • Modify variable: CHANGE_CONFIG_DIR_OWNERSHIP to false
    DSM7-Packaging-2.0-Docker-3

B. Network

  • Set your network. You want to use the Host network - NOT bridged - NOT NAT.

C. Apply the settings to create the container


)

D. Done

That’s it. DSM 7 using the native data without change.

With this configuration, you can stop docker, start native and continue without change.

Please remember – Don’t try to run both at the same time :see_no_evil:

Go to Index

FAQ 28 - DSM Complains Port 32400 In Use When Installing Plex

This error , reported by Package Center, tells you that Plex’s port 32400 is already in use.

The most commonly observed cause of this is having previously installed Plex in Docker but never removing Plex from Docker.

DSM 7 now enforces port usage monitoring and will not allow you to install a program if its main port(s) are in use.

Please open Docker , Check for an old Plex definition / instance, Delete it if no longer in use.

Go to Index

FAQ 29 - DSM 7 - Give PlexMediaServer access to your media

When you migrate to DSM 7, are installing a server for the first time, or just adding a new shared folder / sub-folder for media , folks forget to read the popup at the end of every installation which tells them about how to set permissions.

This FAQ shows in detail how to do what those instructions state.

When might you need to perform these steps?

  • When upgrading, changing permissions from Plex to PlexMediaServer is overlooked.
  • Installing Plex for the first time, new installations must also grant permission for PlexMediaServer to read your media.
  • You copied new media into existing shared folders but it’s not seen.
  • You have 3rd party media tools which don’t understand DSM 7 permissions system

To remedy this:

  1. Open FileStation

  2. Right-click on the shared folder → Properties

  3. Permissions tab

  4. You won’t see PlexMediaServer listed so we need to CREATE a rule
    Screenshot from 2022-09-17 23-21-25

  5. Click Create to open the Permission Editor
    Screenshot from 2022-09-17 23-21-40

  6. The “User or Group” box is blank. Click the scroll down and find PlexMediaServer
    Screenshot from 2022-09-17 23-22-17

  7. Click it
    Screenshot from 2022-09-17 23-22-37

  8. Now click anywhere else inside the editor (over near the Read permissions works)

  9. Click the Read box and click the Write box. PlexMediaServer does not need Administrative permissions

Screenshot from 2022-09-17 23-22-57

  1. Click Done to save the new rule and return you to the Shared Folder menu

  2. Click “Appy to this folder, sub-folders and files”

  3. Click SAVE and let it apply the new permissions rule for PlexMediaServer

Go to Index

1 Like

FAQ 30 - DSM 7 - Database Repair using a Backup copy

The database can get corrupted for a variety of reasons. The most common are abrupt stopping of PMS (power fail, restart, etc)

When this happens, if there are database backups, we can recover by shuffling around the files using FileStation.

  1. Stop PMS if running

  2. Open FileStation

  3. Navigate to PlexMediaServer / AppData / Plex Media Server / Plug-in Support / Databases.

  4. Rename com.plexapp.plugins.library.db to com.plexapp.plugins.library.db--BAD

  5. Select the most appropriate backup copy of the database and copy it to the “Plug-in Support” folder.


  1. Navigate up to “Plug-in Support” and rename to com.plexapp.plug-ins.library.db

  2. MOVE com.plexapp.plugins.library.db back into the Databases folder.

  3. Cleanup
    – REMOVE com.plexapp.plugins.library.db-wal if it exists
    – REMOVE com.plexapp.plugins.library.db-shm if it exists

  4. Confirm everything back to normal.

  5. Start Plex

  6. Give EXTRA TIME for PMS to update the backup database (schema) if needed

  7. When the CPU is normal again (might take 2-3-4 minutes)
    – Scan files for each section
    – Empty trash
    – Clean bundles
    – Optimize Database

Go to Index

FAQ 31: Reset / Reclaim PMS on DSM 7 (Not Authorized - Locked Out)

  1. Uninstall the app - Use the first radio button (KEEP) option.

  2. Reinstall the same, or newer, SPK (package) version.

Now let it install and get updated credentials for your server.
(Getting new credentials takes a little longer than normal install – 10-15 seconds)

If networking is correct, it will complete and show ‘Claimed by: YourPlexUsername’

You may now open the server normally.

Go to Index

2 Likes

FAQ 32: Repairing the PlexMediaServer shared folder

While DSM 7 manages the permission of the PlexMediaServer shared folder itself, it does not manage the permission of files placed inside.

This means any modification of permissions can cause PMS to fail.
Frequent causes:

  1. Placing media in the shared folder – Which should NEVER be done. This is for PMS internal (metadata) use only.
  2. Special allowed case of adding plug-ins but must be installed correctly.

One of the biggest confusion points with DSM 7 over DSM 6 is username change

DSM 6 uses regular username Plex
DSM 7 forced the name to be changed to System Internal User (application) PlexMediaServer

Mistaking these two leads to dire results.

In the event anything is awry in the shared folder (as viewed using FileStation),
an easy method to confirm all file system ownership and permissions are correct is to create and run this task in Task Scheduler.

Create the task in Task Scheduler → User-defined Script

Screenshot from 2022-12-07 16-12-57

  1. Username to run as: root
  2. Email you the results:
  3. Task settings (script) contents:
#!/bin/sh
cd /var/packages/PlexMediaServer/shares/PlexMediaServer
chown -R PlexMediaServer:PlexMediaServer  AppData &
find AppData -type d -exec chmod 755 {} \; &
find AppData -type f -exec chmod 644 {} \; &
wait

Screenshot from 2022-12-07 16-16-27

Run the task

  1. Run the task
  2. Wait for it to send you results in your email
  3. (re) Start PMS.

Go to Index

1 Like

FAQ 33: How to backup your Synology database

The recommended method of backing up PMS is to use Hyper Backup where the entire server’s files plus their ownership, permissions, including date/time stamp is preserved

This FAQ applies to those who want to backup only the databases.

  1. Create a scheduled task → User Script
  2. It must run as user: root
  3. It emails you the results so you have confirmation
  4. Set the ‘Dest’ folder (keep within quotes) to where you want the backup to go.
  5. The body of the script is as follows:
#!/bin/sh

# Set destination  (Set this value)
Dest="/volume1/My Shared Folder"


# Stop Plex
synopkg stop PlexMediaServer
Result=$?

if [ $Result -ne 0 ]; then
  echo ERROR $Result when stopping PlexMediaServer.
  echo Backup aborted.
  exit 1
fi

# Dest exists ?
[ ! -w "$Dest" ] && echo ERROR: Cannot write to '$Dest' && exit 2

# Get into the databases directory  (this is now volume independent)
cd "/var/packages/PlexMediaServer/shares/PlexMediaServer/AppData/Plex Media Server/Plug-in Support/Databases"

# Create filename using Date/Time  (yyyy-mm-dd_hh-mm)
# Backup
tar cvzf "$Dest/Plex-Database-Backup_$(date +%Y-%m-%d_%H-%M).tar.gz" .
Result=$?

# Check result
[ $Result -ne 0 ] && echo ERROR Got exit code $Result from tar.  Please check && exit 

# Restart Plex
synopkg start PlexMediaServer

Go to Index

FAQ 34: Upgrading Plex to DSM 7.2.2+

Server Version#: 1.41.0.8992 +
Player Version#: N/A

DSM 7.2.2 (Package Center) introduced a breaking change to how the SPK file is created and its internal contents. Normally, these type changes occur on major version updates however Synology, this time, released it in a minor update.

While the upgrade can be performed multiple ways, the safest (most reliable) method is:

  1. Stop Plex
  2. Uninstall Plex (select the first radio button – UNINSTALL ONLY; KEEP)
  3. Perform the DSM 7.x → 7.2.2 upgrade
  4. Go to the Downloads Page
  5. Select and download the SPK for your machine
    – If you are uncertain which binary form to use for your machine, go to Control Panel - Info Center
  6. As confirmation, the new SPK file will have DSM72 in the file name.
    – e.g. PlexMediaServer-1.41.2.9092-94c4cffca-x86_64_DSM72.spk
  7. Go to Package Center and perform a Manual Install in the same manner as previously done for all other Plex SPK files.

Go to Index

2 Likes

FAQ 35: Start/Stop Plex using Task Scheduler

Due to a failure in Synology DSM 7.1 Update 7, manual start/stop is below

Synology has stated this will be fixed with their update at the end of February 2025.

Below is how you can start / stop PlexMediaServer without resorting to using SSH


Stop Plex

  1. Create a Task Scheduler task → User Script
  2. Runs as ‘root’
  3. has the command

STOP - Step 1

STOP - Step 2

Command to use:

synopkg stop PlexMediaServer

START - Step 1

Start Plex

  1. Create a Task Scheduler task → User Script
  2. Runs as ‘root’

START - Step 2

Command to use:

synopkg start PlexMediaServer

To Use:

  1. Open Control Panel - Task Scheduler
  2. Select :white_check_mark: the Stop or Start command
  3. Click “Run”
2 Likes