Moving Libraries - Keeping watched status

Ok, so I searched the forums and have read (and followed) these instructions - Move Media Content to a New Location | Plex Support

It is not working for me.

I moved my install of Plex from one NAS to another (newer and larger one). I networked the new NAS to the old NAS at first and this worked perfectly (server on new machine, files on old NAS). Now it is time to move the actual files. I copied them over to the new NAS. However, when I go to add them to the library (in addition to the current file paths), it shows duplicate movies.

I have seen that this is due to the guid being different, and confirmed that by looking at the XML. I have moved the order of the agents, hoping that might help. It did not.

I have a large library and have been running Plex since about 2015, so I have a lot of watched history I’d like to keep. I don’t really care about the other metadata matching so much, but watch history is important to me. I think the new guid issue is because of the new agent change. I did a full metadata refresh and then added the new file paths again, and same result.

Please tell me there is something I am missing! Thanks in advance.

Would you mind sharing more details about the plex installation itself?

DSM version(s) ? PMS version(s)?

That guide is extremely vague and doesn’t really work for Synology.

It especially doesn’t work when crossing DSM versions

We gave Synology specific instructions which do work.

Please advise.

New NAS - DSM 6.2.4-25556. PMS version 1.24.3.5033-6000.

Old NAS - DSM 6.2.4-25556 Update 2. PMS version 1.24.3.5033-6000.

I literally moved the data in the same folders to the new NAS. When I add the new file paths to libraries, though, it is assigning different guid to the files, thus creating duplicate thumbnails and viewed history.

Confirm please ?

MOVE or COPY ?

Also confirm please: You changed the ownership of everything in the Plex shared folder to be owned by user Plex on the new system before starting Plex ?

Did the server identity cross over to the new system ?

Sorry - copy. The files exist on both NASes.

Yes, I added permissions to the Plex user to the new locations - it couldn’t even see the files without these settings (granted full read and all of the write privileges except delete).

I believe the server identity was copied over as part of the server move process. I recall finding IDs and changing those, but forget where to check to confirm.

If the full COPY occurred – nothing would change as it would be ‘cloning a live system’.

Let’s do this again.

On the new system

  1. Stop Plex
  2. File Station → Plex shared folder
  3. Rename Library to Library.broken

On the old system

  1. Again stop Plex
  2. File Station → Plex shared folder
  3. Right-click “Library” → Compress to Library.zip
  4. This will take time to do but will guarantee everything is pristine
  5. When it finishes - COPY it to the new system

Back on the new system

  1. Right-click Library.zip → Unzip here
  2. It will now write all the files in the same structure with all the same date/time stamps
  3. When complete,
  4. Right-Click Library → Properties
  5. Set the owner to user Plex for This folder, sub-folders, and files
  6. When finished,
  7. Start Plex.

You cannot start the old system again without changing the Preferences.xml

The new system has now fully assumed the identity of the old.

EDIT: The reason copy doesn’t work is because symbolic links, which are used for metadata, are not preserved when copying. You end up with two copies instead of the original and a link to it (which is what PMS is looking for).

It is taking forever to compress, but I am following your instructions. Can this folder just be copied uncompressed - my network is faster than the old NAS CPU.

In reviewing the preferences.xml - they are different - Oldest Previous Version, Machine identifiers, Processed Machine Identifiers, Plex Online Tokens, etc.

You mention the old system cannot start again without changing the Preferences.xml - will this be done automatically on start or something I have to manipulate? Are there instructions for that?

@Tigeralum

  1. Yes, it will take a long time.
  2. Yes, you can COPY the file (as I wrote) to the new system. All the needed information is maintained therein.
  3. It will again take time to unzip.

There is no “quick and easy” way to take a long-standing server from host to host unless you’re very skilled at the command line. Even then, it can still take a few hours to do.

One user needed 2 weeks of non-stop processing to upgrade from DSM 6 to DSM 7 because of the amount of data .

This is the problem we all face with NAS CPUs . They just don’t have the CPU power to hammer the HDDs and “get it done”

I just recently moved my Plex off of Synology NAS, and simply ZIPPING up the files took 2 hours to do so. compressed 250GB of data to a 150GB zip. Moving the zip took about an hour. Unzipping the file 2 hours. Moving the files over to the destination system took 4 hours.

I know I didn’t really do things in the right order, but I was putting these files onto a linux system that I had no idea how to unzip, so I unzipped it locally on a windows box then moved them to the linux system using a share owned by the server. Worked fine, but oh man, moving 700,000 files took way longer than just moving the zip file around.

But if you want to direct copy, you CAN. The problem is that modern files systems are really bad at moving thousands of small files. Think of it like moving around boxes in real life. You are forced to only hold one box at a time, no matter the weight. Heavier boxes make you move somewhat slow, but a box that weighs 1 ounce you can still walk to the destination only so fast. If you could combine a hundred boxes together and move one 100lb box, it’d take less time than to move 10000 one ounce boxes.

@Divideby0

You’re forgetting one thing.

On older PMS installations, those with the old agents, the metadata was managed using symbolic links.

Those links , most of which where absolute links, don’t migrate in a ‘copy’ operation.

That’s why DSM 6 → DSM 7 conversion has a ‘Symbolic Links’ phase of the migration where I do all the necessary conversions from absolute to directory relative addressing.

I finished the tasks. When I start the Plex server, the settings look good, but the interface displays ALL media as unwatched. Any ideas on how to fix that?

do all the files have the same date-time stamp on the new system as they did on the old ?

If copied with SMB, they won’t. That’s a limitation of SMB.
I notice the same thing if I access my NAS with SMB.

Moving files from Linux to Linux should always be done with NFS.

No, they all seem to have the timestamp of approximately when they were unzipped.

Do I stop the server, delete the Library file, then simply re-copy the .zip file over NFS and then proceed from there?

@Tigeralum

The date-time stamp of the Plex shared folder contents isn’t important.

I was referring to the media itself.

If the date-time stamp on the media is newer than what’s in the database it’ll see it as new.

I think there’s a way to correct that. .

Don’t delete the Plex share on the old system just yet.

I’m going to write some scripting (scheduled tasks) for you to use.
We can use the Linux-native tools and retest. It won’t be as slow as ZIP.

  1. stop plex on the new system
  2. start plex on the old.
  3. get into it
  4. Settings - Server - Library - show advanced.
  5. Uncheck everything
  6. SAVE
  7. Now stop Plex.

Scheduled Task for Old NAS

  1. control panel - task scheduler - Scheduled task - user-script
  2. General - Run as User: root
  3. Settings (script itself)
    a. fill in your email so it sends you the results (also notifies you)
    b. here’s the commands for it to do
#!/bin/bash

# Scheduled task to create Linux tar backup image 
cd /volume*/Plex
tar cf  Library.tar ./Library

It looks like this
Screenshot from 2021-09-29 00-34-20

I’ll start writing the next one

Ok, thanks. The media themselves have the same dates in both the old and new NAS (timestamps on the actual file). The new root folder, though, does have a more recent date. I can delete the new files and COPY them back via NFS if needed,

Let’s let the media itself alone,

I would like to use the procedure above for this first.

It’s a lot easier, faster, and has higher degree of success.

When the first job (on the old NAS) is complete.

COPY that file to the new one (SMB is fine) into the Plex shared folder.

On the new NAS

  1. Create a task, again running as user root to restore the tar backup
  2. Settings (script itself)
    a. again fill in your email
    b. here’s the commands
#!/bin/bash
# Scheduled task to restore Linux tar backup image 
cd /volume*/Plex

[ -e Library ] && mv Library Library.prev
tar xf Library.tar
chown -R plex:users ./Library

Let me know when this is complete

Files archived, moved, and unarchived.

Good.

If there were no errors,

Start Plex. See if everything comes up as if nothing changed.