Error when transferring plex watch history from windows 10 to ubuntu 22.04

Server Version#: 1.32.0.6918

I have been running a Plex server on a Windows PC, and want to move over to an Ubuntu PC.

I’m trying to do this by just fresh installing Plex and moving over the watch history.

I followed the instructions from Plex to export the data here: https://support.plex.tv/articles/201154527-move-viewstate-ratings-from-one-install-to-another/

I have the settings.sql file, but am having trouble importing it to my new Plex instance in Ubuntu.

When I execute the command:

cat settings.sql | sqlite3 com.plexapp.plugins.library.db

I get this error:

Error: near line 1: in prepare, near "��P": syntax error (1)

I’m lost on where to look or what to try next, any suggestions are appreciated.

  1. With the Windows DB file somewhere on the Linux server host.

  2. Use this to export from the Windows DB into the PMS DB (PMS stopped)

1 Like

@ChuckPa , thank you for the information.

I have extracted the DBRepair.sh file to the folder with my settings.sql file and the Plex db files.

When I try to execute it, I get Error: Unknown host...

As I said, I’m running Ubuntu 22.04. That should be compatible, correct? Is there something I need to change in order for it to be recognized?

Run as ‘root’ ( sudo ) ?

Did you install from the Plex.tv/downloads file or did you install from the Ubuntu App Store ?

(I don’t currently support Ubuntu App Store – Snap packages but might consider it)

Ah, that must be it, I did install from the App store.

So there would probably be no way around it besides uninstalling and installing from Plex.tv?

If you uninstall then you have all that metadata you would need to either trash or move over to where the native package install it.

I can give you the instructions if you’re comfortable with Linux command line (you should be as Linux user)

Definitely, I’d appreciate the Linux instructions.

I’m pretty new to Linux, but I think I can figure it out.

– download from plex.tv/downloads
– sudo dpkg -i path/to/the/plexmediaserver-x.x.x.x.deb (downloads directory)
– systemctl stop plexmediaserver

Now you can

  1. sudo bash
  2. cd /var/lib/plexmediaserver
  3. mv Library Library.unused
  4. snap stop plexmediaserver
  5. cd /var/snap/plexmediaserver/common
  6. tar cf - ./Library | (cd /var/lib/plexmediaserver ; tar xf - )
  7. cd /var/lib/plexmediaserver
  8. chown -R plex:plex ./Library

From this point forward, instead of typing
snap to start/stop plexmediaserver, you’ll use systemctl

make sense?

After you have that all done, AND running the native package (systemctl),
you can sudo snap remove --purge plexmediaserver

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.