# Migration Questions

**URL:** <https://forums.plex.tv/t/migration-questions/789283>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [April 20, 2022, 9:18pm UTC](https://forums.plex.tv/t/migration-questions/789283 "2022-04-20T21:18:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [April 20, 2022, 9:18pm UTC](https://forums.plex.tv/t/migration-questions/789283/1 "2022-04-20T21:18:38Z")

</div>

Hi all,

I presently have a PMS on a Linux Server that I want to move to another Linux Server. I want to maintain the users watched history and the date added dates for the Movies.

While I know how to transfer the watched history the date added is not so easy, so I was wondering if just copying the PMS directory from one to the other is a valid option.

This is the directory I’m talking about:

[![](https://i.imgur.com/TiWA7cK.jpeg) ](https://i.imgur.com/TiWA7cK.jpeg)

Thoughts/comments would be greatly appreciated.

EDIT: The Library locations will be different on the new Server but the content will be the same.

TIA

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [April 20, 2022, 10:13pm UTC](https://forums.plex.tv/t/migration-questions/789283/2 "2022-04-20T22:13:58Z")

</div>

Very simple operation.

### Source machine:

1. Turn off all automatic Library settings (don’t forget to SAVE)
2. Stop Plex
3. Make the image

```auto
sudo bash
cd /var/lib/plexmediaserver
tar cf /path/to/safe/place/PlexBackup.tar ./Library

```

Transport that to the new machine.  
The reverse of that will be the base steps:

1. Install Plex
2. Stop Plex
3. cd /var/lib/plexmediaserver
4. sudo rm -rf Library
5. sudo tar xf /path/to/PlexBackup.tar
6. sudo tar chown -R plex:plex ./Library

Now follow the steps I skipped here (near the end) about adding the new locations BEFORE YOU DELETE the old locations. This is how we keep the metadata and other history.

> [@Linux Tips](https://forums.plex.tv/t/linux-tips/276247/23):
>
> Migration from another OS to Linux Cross OS migration is a multi-level process. Copy the PMS databases and metadata Update all the media locations to point to their new locations. Prerequisites - On the originating host Settings - Server - Library Turn off: Scan my library automatically Run a partial scan when changes are detected Include music libraries in automatic scans Scan library periodically Empty trash automatically after every scan Stop Plex ZIP up the “Plex Media Server”…

---

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [April 20, 2022, 10:36pm UTC](https://forums.plex.tv/t/migration-questions/789283/3 "2022-04-20T22:36:38Z")

</div>

Thank you once again @ChuckPa . I will take a read before proceeding, but when you say to turn OFF the automatic Library Settings you mean Settings | Library. Correct?

EDIT: After reading the doc you linked I’m now clear where the Automatic Setting are, thank you.

At the end to the doc it says:  
Empty Trash  
Clean the bundles  
Optimise the database

Can you tell me where I find these functions? Thanks once more.

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [April 20, 2022, 11:28pm UTC](https://forums.plex.tv/t/migration-questions/789283/4 "2022-04-20T23:28:07Z")

</div>

> [@gregeeh](#):
>
> At the end to the doc it says:  
> Empty Trash  
> Clean the bundles  
> Optimise the database

Hover over the server’s name (Left Pane).  
Expose the “+” and “…” (ellipsis).

Under the Ellipsis, you’ll find these actions (they are server global)

---

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [April 20, 2022, 11:32pm UTC](https://forums.plex.tv/t/migration-questions/789283/5 "2022-04-20T23:32:01Z")

</div>

Too easy, thank you.

---

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [April 21, 2022, 12:41am UTC](https://forums.plex.tv/t/migration-questions/789283/6 "2022-04-21T00:41:29Z")

</div>

Followed the instructions, but get the message that the PMS Server is unavailable.

Could this have something to do with the source and target where on different ports?

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [April 21, 2022, 1:10am UTC](https://forums.plex.tv/t/migration-questions/789283/7 "2022-04-21T01:10:58Z")

</div>

Different ports? You should be opening port 32400 or is this a remote server?

Get to the shell.

Make sure the processes are up and running.

You might need to reclaim it by opening, incognito, by the LAN IP (same subnet).  
(you shouldn’t use app.plex.tv for this step)

---

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [April 21, 2022, 1:22am UTC](https://forums.plex.tv/t/migration-questions/789283/8 "2022-04-21T01:22:31Z")

</div>

> [@ChuckPa](#):
>
> Different ports? You should be opening port 32400 or is this a remote server?

Yes, it’s a remote server. Makes a difference??

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [April 21, 2022, 1:24am UTC](https://forums.plex.tv/t/migration-questions/789283/9 "2022-04-21T01:24:07Z")

</div>

Yes.

SSH tunnel to it.

```auto
ssh -L 8888:127.0.0.1:32400 ip.addr.of.server

```

Now log into that remote shell and let the session sit idle.

Locally,

1. Open incognito window
2. Open [http://127.0.0.1:8888/web](http://127.0.0.1:8888/web)

The trafffic will route local port 8888 → remote port 32400 and add the `/web` endpoint .

It will be as if local to the console.

When confirmed claimed and running, you can close the ssh session.

---

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [April 21, 2022, 1:29am UTC](https://forums.plex.tv/t/migration-questions/789283/10 "2022-04-21T01:29:32Z")

</div>

The installation on the remote hosted PMS requires you to claim it before installation will proceed.

Do I change this command:

`ssh -L 8888:127.0.0.1:32400 ip.addr.of.server`

from 32400 to the actual PMS port number (14175)?

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [April 21, 2022, 1:33am UTC](https://forums.plex.tv/t/migration-questions/789283/11 "2022-04-21T01:33:15Z")

</div>

It is not possible to claim before installing because claiming is an active communication between PMS and Plex.tv.

No you do not use the external port (14175). You are ‘inside’ the host. When inside the host, always use 32400.

Please provide more info. I’m not understanding the operating environment.

Is this some kind of Docker container?

---

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [April 21, 2022, 1:35am UTC](https://forums.plex.tv/t/migration-questions/789283/12 "2022-04-21T01:35:40Z")

</div>

> [@ChuckPa](#):
>
> Is this some kind of Docker container?

Yes it is.

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [April 21, 2022, 1:45am UTC](https://forums.plex.tv/t/migration-questions/789283/13 "2022-04-21T01:45:43Z")

</div>

This is going to be a pain.

You said you were migrating PMS and I assumed a native install → native install.

When you add migrating a docker container, it all goes sideways EASILY.

What’s the host platform? Is it Proxmox or OMV ?

---

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [April 21, 2022, 1:49am UTC](https://forums.plex.tv/t/migration-questions/789283/14 "2022-04-21T01:49:48Z")

</div>

> [@ChuckPa](#):
>
> What’s the host platform? Is it Proxmox or OMV ?

Neither, it’s a Seedbox. Problem made worse as source is not Docker and target is Docker.

I can transfer the watched status for the various users but it’s the Date Added that is all screwed up. Maybe I just have to live with it.

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [April 21, 2022, 1:57am UTC](https://forums.plex.tv/t/migration-questions/789283/15 "2022-04-21T01:57:42Z")

</div>

Ok. That’s going to be a gamble.

Best advice I can give you is as follows.

1. Keep that `tar` file (the cloned backup of the source machine. You’ll still need it.  
– You will need to `scp` that file up to the seedbox.

2. Create the docker except:  
a. Do not add the PLEX\_CLAIM token string into the config  
b. Set the PUID,PGID,PLEX\_UID, PLEX\_GID to match the UID/GID of the host PMS is coming from  
c. Let it run for a moment then stop it.

3. Get into the Seedbox’s native filesystem.

4. You want to be wherever `/config` is mapped to.

5. In the filesystem, where `/config` is mapped, you’ll see `Library`. This is our target

6. The goal is to take your `./Library` tar ball and REPLACE its `Library` directory without docker knowing, with the one you’re bringing over.  
a. From the shell, in the host OS, cd `/wherever/config/is`  
b. `mv Library Library.junk`  
c. `tar xf /path/to/original/host/PlexBackup.tar`

7. What the above should do for you, which you need confirm, is create a perfect `Library/Application Support/Plex Media Server` structure with all the subdirectories included.

8. Before advancing further, `ls -la` to see if the UID/GID of `Library` and `Library.junk` match.

9. Perform a `chown -R UID.GID ./Library` if appropriate to make the transplanted data match the container internal environment.

10. Once done, Spin it up

---

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [April 21, 2022, 2:28am UTC](https://forums.plex.tv/t/migration-questions/789283/16 "2022-04-21T02:28:04Z")

</div>

Thanks @ChuckPa for all your time. I will give it a go.

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [April 21, 2022, 2:44am UTC](https://forums.plex.tv/t/migration-questions/789283/17 "2022-04-21T02:44:39Z")

</div>

Make sure you understand what we’re trying to do at each step.

By understanding my intent, you can adapt on the the fly if things aren’t entirely as I wrote out.

Do ask if you encounter any issues

---

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [April 21, 2022, 2:58am UTC](https://forums.plex.tv/t/migration-questions/789283/18 "2022-04-21T02:58:33Z")

</div>

> [@ChuckPa](#):
>
> Do ask if you encounter any issues

Will do, thank you.

---

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [April 21, 2022, 5:17am UTC](https://forums.plex.tv/t/migration-questions/789283/19 "2022-04-21T05:17:01Z")

</div>

I’m making progress, however seems I cannot have both servers (old & new) show up on the PMS home page.

`http://<IP_OF_PMS>:32400/identity` of both servers show the same ID:

MediaContainer size=“0” claimed=“1” machineIdentifier=“same-ID-is-Here” version=“1.25.9.5721-965587f64”\> \</MediaContainer

This might be an issue?

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [April 21, 2022, 5:48am UTC](https://forums.plex.tv/t/migration-questions/789283/20 "2022-04-21T05:48:03Z")

</div>

That’s correct. Plex.tv tracks servers by their ID. You cloned one to take to the other.  
At this point, they are mutually exclusive.

To remedy this we will change the host-native server. (don’t mess with Docker)

1. Stop Plex

2. Go to `/var/lib/plexmediaserver/Library/Application Support/Plex Media Server`

3. As ‘root’, using the text editor of your choice, edit `Preferences.xml`.

4. VERY CAREFULLY, remove the following `Name="Value"` pairs (the entire pair=value)

- MachineIdentifier
- ProcessedMachineIdentifier
- AnonymousMachineIdentifier

1. SAVE the file

2. Start PMS

3. Open the server by LAN IP and make certain it claims again.

We are going to void the certificate for this server and issue it a new one as soon as you have it running and claimed. (I need to be able to distinguish which is which at Plex.tv)

If you have other plans here - Please do let me know in advance if possible.

> [@gregeeh](#):
>
> I presently have a PMS on a Linux Server that I want to move to another Linux Server.

I didn’t know you were going to run both simultaneously.

[Next page](https://forums.plex.tv/t/migration-questions/789283.md?page=2)
