Moving Viewstate To New Desktop

Server Version#: 1.19.3.2764
Player Version#: 4.33.1

Issue: cmd returns “‘grep’ is not recognized as an internal or external command, operable program or batch file.”

Background: Built a new Windows PC, installed Plex, moved HDDs over, got everything installed and working, then realised I want to preserve the viewstates. Still have my old C: drive SSD and an external cradle, so it’s accessible.

Research: I’ve tried following the article at Move Viewstate Guide, but the SQLite instructions are non-existent. Then tried following the slightly-more-detailed instructions at Move Viewstate Forum Question, but that hasn’t helped either.

Method: I downloaded the SQLite tools precomplied binary from sqlite.org, copied sqlite3.exe to %LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases, then ran cmd:

cd “%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases”

then

echo “.dump metadata_item_settings” | sqlite3 com.plexapp.plugins.library.db | grep -v TABLE | grep -v INDEX > settings.sql

and it returns

‘grep’ is not recognized as an internal or external command, operable program or batch file.

What am I doing wrong? There shouldn’t be any other steps? I have zero knowledge of SQLite or grep or any other function; I’m assuming grep is included in SQLite and not a separate utility?

Also, I’ve added new files to the new PC, and watched a few new and old shows. So assuming I can get this working, if I just temporarily move those new files out of the watched library locations and mark everything else as unwatched, will that work? Or do I need to do a clean install?
Thanks in advance, this is doing my head in.

If it’s a new server, just copy the whole .db file over from old to new server.

I was wondering this from the start, instead of exporting and importing and all that, can I just copy paste com.plexapp.plugins.library.db? ̶S̶e̶e̶m̶s̶ ̶w̶e̶i̶r̶d̶ ̶t̶h̶a̶t̶ ̶i̶t̶’̶s̶ ̶n̶o̶t̶ ̶l̶i̶s̶t̶e̶d̶ ̶o̶n̶ ̶t̶h̶e̶ ̶w̶e̶b̶s̶i̶t̶e̶ ̶a̶s̶ ̶a̶n̶ ̶o̶p̶t̶i̶o̶n̶.̶ ̶D̶o̶ ̶I̶ ̶n̶e̶e̶d̶ ̶t̶o̶ ̶r̶e̶m̶o̶v̶e̶ ̶t̶h̶e̶ ̶-̶s̶h̶m̶ ̶a̶n̶d̶ ̶-̶w̶a̶l̶ ̶f̶i̶l̶e̶s̶ ̶b̶e̶f̶o̶r̶e̶h̶a̶n̶d̶?̶ ̶(̶R̶e̶a̶d̶ ̶t̶h̶a̶t̶ ̶o̶n̶ ̶o̶n̶e̶ ̶o̶f̶ ̶t̶h̶e̶ ̶g̶u̶i̶d̶e̶s̶.̶)̶

Wow, yeah good point. I was too focused on trying to do the “easy fix”, I forgot I could have just replaced it. Worked straight away. Looks like there are a few issues, but rescanning and refreshing all metadata should hopefully fix everything. Thanks!

If you are just swapping hardware, but are not changing the layout of either the media files, nor the Plex libraries, then you can also opt to copy the whole Plex data folder from the old to the new server.

The transition is running much smoother, if the media files remain on the exact same drive letter/network share addresses/folder names.
Make sure your media drives get the same drive letter on the new machine.

Nah, I was pretty callous about it. Changed drive letter paths and folder structures.
So all I did was copy com.plexapp.plugins.library.db from the old system to the new, then scanned all library files and refreshed all metadata. Had to correct a few matches and re-enable emptying trash after each scan, but now my viewstates are all restored and everything is working.

Thanks for your help! Although I still don’t know why grep wasn’t being recognised. Sorry to anyone else with that issue.

grep is a UNIXoid app.
It is not available on Windows, except if you enable the Linux subsystem.

You might also be able to find a version that runs directly on Windows.
http://gnuwin32.sourceforge.net/packages/grep.htm

That’s what I thought, but all the forum posts from 5yrs back, and the official advice, say that on Windows you only need to download SQLite and then everything will magically work. Glad it wasn’t me doing something wrong then.

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