Copying user settings

Hi

Loving Plex Home! I can think of lots of ways this can improve my Plex setup.

I'm thinking of keeping my main account as an admin account, and adding a new HTPC user for the lounge.

Is there some way, inside or outside of plex, to copy things like the watched status, etc.between the old admin user and the new HTPC user?

Thanks

I was wondering the same thing... I mostly want to copy my watched/unwatched status from my main account to a secondary account

Yep... we need this function (or a work around) to do this... Only reason I'm not using Home feature right now separating the family members... the main account (admin) has all our watched, etc...

And Trakt channel doesn't work with Plex home (yet) so can't sync them...

A workaround would be to modify the database directly.  The watched status is saved in a table with the user info attached to it.  You could copy the contents of the table and change the user to the one you want.  Then go back and do a check of the records to make sure that the other user has access to all the movies listed.  Not sure if there would be a problem skipping this last step.

I would prefer if you could just link your Admin account to your Managed User account and thereby always keeping them in sync.

I would prefer if you could just link your Admin account to your Managed User account and thereby always keeping them in sync.

I'm not so sure - surely, if that's what you want, then why not use the Admin account anyway?

How about having the option, when you create a user, to copy the profile of an existing user - a simple drop-down on the Add User box to clone a current user. That shouldn't be too difficult.

A workaround would be to modify the database directly.  The watched status is saved in a table with the user info attached to it.  You could copy the contents of the table and change the user to the one you want.  Then go back and do a check of the records to make sure that the other user has access to all the movies listed.  Not sure if there would be a problem skipping this last step.

Any procedure for dummies would be appreciated here  ;) (command to execute in SQL manager)

First identify the id numbers for the accounts involved.
 
SELECT id, name FROM accounts;
 
Create a temporary blank copy of the table.  I call it temp.
 
CREATE TABLE "temp" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "account_id" integer, "guid" varchar(255), "rating" float, "view_offset" integer, "view_count" integer, "last_viewed_at" datetime, "created_at" datetime, "updated_at" datetime, 'skip_count' integer DEFAULT 0, 'last_skipped_at' datetime DEFAULT NULL);
 
Copy over the info for the source user.  I used the admin.
 
INSERT INTO temp SELECT * FROM metadata_item_settings WHERE account_id = 1;
 
Change the id to the new user.
 
UPDATE temp SET account_id = 101010;
 
Copy this new info back to the original table.
 
INSERT INTO metadata_item_settings (account_id, guid, rating, view_offset, view_count, last_viewed_at, created_at, updated_at, skip_count, last_skipped_at) SELECT account_id, guid, rating, view_offset, view_count, last_viewed_at, created_at, updated_at, skip_count, last_skipped_at FROM temp;
 
Delete the temp table.
 
DROP TABLE temp;
 
Done.

YOU ARE THE MAN!

Just tested it, works perfectly, thank you so much.

Now I can start a managed user with all watched, etc... states from main account. :)

***This should be pinned or even in KB IMO....  (well unless/until Plex adds this option in the UI)

First identify the id numbers for the accounts involved.
 
SELECT id, name FROM accounts;
 
Create a temporary blank copy of the table.  I call it temp.
 
CREATE TABLE "temp" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "account_id" integer, "guid" varchar(255), "rating" float, "view_offset" integer, "view_count" integer, "last_viewed_at" datetime, "created_at" datetime, "updated_at" datetime, 'skip_count' integer DEFAULT 0, 'last_skipped_at' datetime DEFAULT NULL);
 
Copy over the info for the source user.  I used the admin.
 
INSERT INTO temp SELECT * FROM metadata_item_settings WHERE account_id = 1;
 
Change the id to the new user.
 
UPDATE temp SET account_id = 101010;
 
Copy this new info back to the original table.
 
INSERT INTO metadata_item_settings (account_id, guid, rating, view_offset, view_count, last_viewed_at, created_at, updated_at, skip_count, last_skipped_at) SELECT account_id, guid, rating, view_offset, view_count, last_viewed_at, created_at, updated_at, skip_count, last_skipped_at FROM temp;
 
Delete the temp table.
 
DROP TABLE temp;
 
Done.

never use SQL before, could you give me a step by step of what to do ?

Exit PMS and backup the database.

Download the zip file from here.  It is is 1 file, sqlite3.exe:  http://www.sqlite.org/2014/sqlite-shell-win32-x86-3080702.zip

Extract the exe file and put it in the folder with your database.  Open a command prompt and type.

sqlite3.exe com.plexapp.plugins.library.db

The prompt will change to sqlite>

Type in the commands from above post.  When done, close the window.

Exit PMS and backup the database.

Download the zip file from here.  It is is 1 file, sqlite3.exe:  http://www.sqlite.org/2014/sqlite-shell-win32-x86-3080702.zip

Extract the exe file and put it in the folder with your database.  Open a command prompt and type.

sqlite3.exe com.plexapp.plugins.library.db

The prompt will change to sqlite>

Type in the commands from above post.  When done, close the window.

your the man!!!, cheers mate.

Is there a way to automatically propagate future watched episodes back up to the master account?

No.

Fair enough.  Would anyone besides me be interested in that feature?

Fair enough.  Would anyone besides me be interested in that feature?

https://forums.plex.tv/topic/129812-fr-plex-home-common-accounts/#entry779089

Is there a way to automatically propagate future watched episodes back up to the master account?

An SQLite trigger may be able to handle such a thing?  Haven't worked with SQLite much recently, so others would need to verify if that's a workable solution.

That is an interesting idea.  I have not used triggers but theoretically it looks like it could work.  Would need to do some testing to see how it behaves with Plex or even if the triggering would work.

If it's anything like Mysql triggers, I don't think you'll be able to modify the table (Table-A) that fired the trigger.  You'd have to modify a separate table (Table-B ), then have a trigger on Table-B modify Table-A -- being very careful that the data/trigger structure doesn't get you stuck in a loop. (The Table-B trigger that modifies Table-A will likely cause Table-A's trigger to fire again.  It's important that the modification that third trigger from the original event makes to Table-B does not unnecessarily cause Table-B's trigger to fire again. (The rows it's trying to modify already exist as such.)  It gets tricky.)

Good point.  Might not work in this case.  I will try some tests later and see.