If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Moving metadata to new location finally works!

oneballjayoneballjay Posts: 17Members ✭✭
edited June 2015 in Linux

I was having problems with plex starting after editing /etc/default/plexmediaserver file and pointing the metadata line to a new location. I created a folder within my /home partition called plexMD and copied the folder located at /var/lib/plexmediaserver to it. Now I am not sure if I am Dyslexic, but even following some how-to's ended up in frustration. So down below is a cut and paste from a tutorial I found..just edited it some and it worked! The original link to the it is at: http://www.geeklee.co.uk/migrate-plex-media-server-metadata-ubuntu/

 

I appreciate the information presented by the author of the link and wanted to give credit where it's due...that being said doing what is listed below worked for me and hopefully will work for you, if you are having problems.BTW You can create the directory elsewhere or name it whatever you want JUST make sure to follow the general structure...especially within the /etc/default/plexmediaserver config file...slashes in certain areas and no quotes make ALL the difference...trust me.

This worked on a freshly installed and updated system running: ubuntu 14.04 LTS 64-bit and Plex Media Server for Ubuntu 64-bit ver. 0.9.12.4.1192-9a47d21

 

 

Create New Directory

  1. Go into terminal and type:
    $ sudo mkdir -p /home/yourusernamehere/plexMD/plexmediaserver

 

Migration

  1. Stop the plexmediaserver service:
    $ sudo service plexmediaserver stop

  2. Rename /var/lib/plexmediaserver to /var/lib/plexmediaserver_old
    $ sudo mv /var/lib/plexmediaserver /var/lib/plexmediaserver_old

  3. Copy (recursively) /var/lib/plexmediaserver_old to your new location (or other disk area)
    $ sudo cp -R /var/lib/plexmediaserver_old/* /home/yourusernamehere/plexMD/plexmediaserver

  4. [OPTIONAL] You can double check everything has been copied by checking the contents and size of the directory:
    $ ls -al /home/yourusernamehere/plexMD/plexmediaserver
    There should be a Library folder in the above directory)
    $ du -sh /var/lib/plexmediaserver_old && du -sh /home/yourusernamehere/plexMD/plexmediaserver/
    This will report the size of the original and new directory.

  5. Change ownership of new area (recursively) for the user plex:plex
    $ sudo chown -R plex:plex /home/yourusernamehere/plexMD

  1. Edit /etc/defaults/plexmediaserver, look for line beginning PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR.
    $ sudo gedit /etc/default/plexmediaserver

  2. Update the line to your new area BUT keeping the trailing “Library/Application\ Support” e.g.
    PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/yourusernamehere/plexMD/plexmediaserver/Library/Application\ Support

     

  3. Start the plexmediaserver service:
    $ sudo service plexmediaserver start

  4. Confirm you get a start/running and a Process ID.  You can also check the service is running:
    $ sudo service plexmediaserver status

  5. Browse the Plex Web Client and confirm everything is OK and as you left it (it should be)

Back Out

If the worst happens, back out is straight forward:

  1. Stop the plexmediaserver service:
    $ sudo service plexmediaserver stop

  2. Rename /var/lib/plexmediaserver_old to /var/lib/plexmediaserver
    $ sudo mv /var/lib/plexmediaserver_old /var/lib/plexmediaserver

  3. Edit /etc/defaults/plexmediaserver, look for line beginning PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR.
    $ sudo gedit /etc/default/plexmediaserver

  4. Comment out this line with a e.g.
    # PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/yourusernamehere/plexMD/plexmediaserver/Library/Application\ Support

  5. Start the plexmediaserver service:
    $ sudo service plexmediaserver start

  6. Confirm you get a start/running and a Process ID.  You can also check the service is running:
    $ sudo service plexmediaserver status

  7. Browse the Plex Web Client and confirm everything is back to normal.

Comments

  • benharvey1985benharvey1985 Posts: 12Members Plex Pass

    moved files as mentioned above, but all i seem to get when i try and load up the web interface afterwards is 404 not found...

  • benharvey1985benharvey1985 Posts: 12Members Plex Pass
    edited July 2015

    me again, figured out the problem...

    this is it

    • Edit /etc/defaults/plexmediaserver, look for line beginning PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR.
      $ sudo gedit /etc/default/plexmediaserver

      • Update the line to your new area BUT keeping the trailing “Library/Application\ Support” e.g.
        PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/yourusernamehere/plexMD/plexmediaserver/Library/Application\ Support

    then end part should not have "Library/Application\ Support" it should just be "Library/Application Support"

    the \ seems to break it!

    even if this only helps one person ill be glad i commented back!

  • oneballjayoneballjay Posts: 17Members ✭✭

    Just did a little testing. The problem you have is you KEPT the quotes surrounding the location. If you tried:

    PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/myusername/plexMD/plexmediaserver/Library/Application\ Support

    notice without the quotes...can be pretty sure it would have worked

    Also was curious, so decided to try it WITH the quotes:

    PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/home/myusername/plexMD/plexmediaserver/Library/Application Support"

    and it works as long as you remove the slash in front of support (like you stated).

    More then one way to skin a cat ;)

  • SpynotebookSpynotebook Posts: 19Members Plex Pass

    I just did this step-by-step and mine will not start at all. Any ideas how to troubleshoot?

  • SpynotebookSpynotebook Posts: 19Members Plex Pass

    I do not know what my issues were but it is working now.

  • gkmcdgkmcd Posts: 1Members, Plex Pass Plex Pass

    Just went through this myself - I'm on Arch, OP's instructions work fine, with the following adjustments to suit Arch:

    • Start/stop plex with systemctl start|stop plexmediaserver.service
    • Plex metadata directory is /var/lib/plex
    • Plex conf file is /etc/conf.d/plexmediaserver
  • Anton.jelleAnton.jelle Posts: 11Members, Plex Pass Plex Pass

    thanks for the guide still working on ubuntu 16.04 with Plex server Version 1.7.6.4058

  • mdnitoilmdnitoil Posts: 380Members, Plex Pass Plex Pass

    The pinned Linux FAQ at the top of the board goes through the Ubuntu steps in very good detail.

Sign In or Register to comment.