Added an existing user and all my managed users disappeared!?!?!?!?!

Older thread but I thought I add to it for anyone else.

Awhile ago I accepted an invite to another Plex Home. The mistake was mine as I didn’t fully read the invite email that warned me of losing my current Home shares and users. Anyways I tried the fix reported in this thread but couldn’t get it to work. So here is what I did.

First I left the new Home I accepted. Then I recreated all my Home users. All of your previous Home user stats are still in the database but are inactive and unable to be reactivated iirc. So you need to swap the old with the new. Update all your old account_ids with the new. Here is how to do it.

First I found the old and new account_id:

old account_id
12345678 Me

new account_id
98765432 Me

Then I, made a copy of my database to work with and found the tables where these account_ids exist in the Plex database.

media_part_settings
metadata_item_settings
metadata_item_views
metadata_item_accounts
statistics_bandwidth
statistics_media

Then, using SQLite I ran the ran the following commands to update the database to use the new account_id for all the old entries.

UPDATE media_part_settings SET account_id = 98765432 WHERE account_id = 12345678;
UPDATE metadata_item_settings SET account_id = 98765432 WHERE account_id = 12345678;
UPDATE metadata_item_views SET account_id = 98765432 WHERE account_id = 12345678;
UPDATE metadata_item_accounts SET account_id = 98765432 WHERE account_id = 12345678;
UPDATE statistics_bandwidth SET account_id = 98765432 WHERE account_id = 12345678;
UPDATE statistics_media SET account_id = 98765432 WHERE account_id = 12345678;

I ran these commands for each of my Home account_ids. I then shutdown Plex and moved the updated db in place and started Plex again. All my users and stats, playlists, etc. were back.

Next step was for Tautulli. Same deal. Copy db and run the following for each account_id.

UPDATE session_history SET user_id = 98765432 WHERE user_id = 12345678;

Replace old db with modified. Restart Tautulli.

All my other users (Friends) were existent but without shares. So I used my plex_api_share.py to quickly bring everyone back to what they were shared. Even that was tedious so I updated that script to allow for backing up your users’ shares and restore those sharing settings from the backup file.

This is was a while ago so I maybe missing some parts of the process. But hopefully someone else may find this helpful.

8 Likes