Jump to content

Restore user accounts from Emby folder.


Recommended Posts

Posted

The OS HDD on my Emby server has failed, I was able to replace and restore a backup from a few months ago and now need to recreate the user accounts. Is it possible to restore user accounts from within the Emby folders in C:\Users\"User name"\App Data\Roaming\Emby-Server ? Copy over a folder of DB file? I have managed to retrieve the users Emby folders off the corrupt drive but have rearranged the drives on this machine. If I just copy that folder over I'm concerned that chaos will ensue. 

 

Thank you.

Kerry

Happy2Play
Posted

If you have the access to existing Emby-Server folder, copy entire programdata from old to new.

But to your specific question the users.db should be all you need.  But all userdata is in the library.db so you may be able to export the userdata table and import into the new libary.db.

C:\Users\{Username}\AppData\Roaming\Emby-Server\programdata\data

Posted

I found a backup made by the Server Configuration backup and that did the trick. Thanks for your help.

  • Thanks 1
Happy2Play
Posted

Yes the Server Configuration Backup plugin is the best method for Users and Userdata.

  • 2 years later...
Posted

Hey Happy2Play,

Have a question for you:

I recently migrated from a windows Server to Unraid and successfully migrated from a backup I made (and I still have  access to the windows server machine).

However after a while I realized after the migration, access to my libraries very extremely slow and laggy.

So I made a new installation of the emby docker and started creating the Libraries with exact same names. I then created all the users with the same names and using extract data from the backup plugin and I restored the users watched contents and I can confirm they are working.

However when I tried to login with one of the users to check for their watched contents, I realized their profile is not password protected anymore. So everyone's passwords are gone.

Is there anyway I can restore their passwords as well? Do I simply copy users.db form windows Server Library to the Unraid appdata folder?

Thanks.

 

Happy2Play
Posted
1 hour ago, parhamsan said:

Is there anyway I can restore their passwords as well? Do I simply copy users.db form windows Server Library to the Unraid appdata folder?

Techically yes, but since you "then created all the users with the same names" you could have created an index/id issue unless created in exact same order as previous users.db.

You could go into each db to verify each use has the same ID

Posted (edited)
6 minutes ago, Happy2Play said:

Techically yes, but since you "then created all the users with the same names" you could have created an index/id issue unless created in exact same order as previous users.db.

You could go into each db to verify each use has the same ID

I just created a backup of the users.db (users.db.backup) on the Unraid and copied the users.db from windows backup folder and when I started emby it kept spinning and didn't get into to the main screen, so no go with this method!

How do I do this:

"You could go into each db to verify each use has the same ID"

and what do you suggest if I want to at least see the current passwords for the users? Is there anyway to extract them from old database?

I don't what to start asking the 20 users the same question, and don't want to restore form old backup since it corrupted my database!

Thanks.

Edited by parhamsan
Posted (edited)

Right now backup plugin is a catch 22.

1) Restore bad DB with everything.

2) Start fresh and create users and ask for there password.

Had to do this when 4.8 was released, because I wanted to start fresh, with the new version.

Tbh this is a sh%t show, compared to the old backup metode.

 

On the positiver side, I could exclude some of my users since they never replied or complained 🤣😂

 

Side note.

I now keep a secure log of my users and password, on a usb stick hidden away.

And I do not let them change passwords on there own, then update the stick.

Edited by Neminem
Happy2Play
Posted (edited)
14 minutes ago, parhamsan said:

I just created a backup of the users.db (users.db.backup) on the Unraid and copied the users.db from windows backup folder and when I started emby it kept spinning and didn't get into to the main screen, so no go with this method!

How do I do this:

"You could go into each db to verify each use has the same ID"

and what do you suggest if I want to at least see the current passwords for the users? Is there anyway to extract them from old database?

I don't what to start asking the 20 users the same question, and don't want to restore form old backup since it corrupted my database!

Thanks.

Not sure without seeing server log to see if anything was logged as dbs are sort of match with the backup process maintaining all.   But the user passwords are hashed/salted in the db.  But open the dbs in any viewer and copy from one to the other.

Example from a test server ie two users index/id 1 and 2 so 1 and 2 correspond to the usersdatas table in the library.db tracking userdata.  So that is where I was getting to about creation when recreating.

image.thumb.png.0e2672697b63b9d2fc9474cf7ed31479.png

But you could copy the data per user from one db to another as it will show the name for each.

image.thumb.png.ee89b42b1b1d265930540f748fb9b606.png

Edited by Happy2Play
Happy2Play
Posted
16 minutes ago, Neminem said:

Tbh this is a sh%t show, compared to the old backup metode.

To a point yes as the old method extracted all the data as was able to import into new.  Now there isn't an easy method to import users into a new install.

  • Agree 1
Posted

I guess the question is ?

1) What good is the backup, if you have to import the corrupted db into a new db ( Now corrupted db ).

2) You can import user data but you need to ask ppl for there credentials.

This is not a backup, its a F#¤kup.

Sorry about being blunt .

Happy2Play
Posted
1 minute ago, Neminem said:

I guess the question is ?

1) What good is the backup, if you have to import the corrupted db into a new db ( Now corrupted db ).

2) You can import user data but you need to ask ppl for there credentials.

This is not a backup, its a F#¤kup.

Sorry about being blunt .

In the end everything should be a package deal from a backup and restore standpoint.  But the catch is same platform as one you go cross platform you have to deal with the consequences as path will never align.

So tools need to exist to extract all relevant data in a cross platform restore scenario as Backup and Restore is not there for this scenario.

Posted (edited)
28 minutes ago, Happy2Play said:

In the end everything should be a package deal from a backup and restore standpoint.  But the catch is same platform as one you go cross platform you have to deal with the consequences as path will never align.

So tools need to exist to extract all relevant data in a cross platform restore scenario as Backup and Restore is not there for this scenario.

Yes that's true, once you cross platforms / OS, there will be discrepancies that will be extremely hard to handle.

windows to linux.

c:\media\  ->  /mnt/media

Now that hard to handle.

But why this current mess, where we can not do what we did.

Same OS new install, move only users and watch history, without ether.

57 minutes ago, Neminem said:

1) Restore bad DB with everything.

2) Start fresh and create users and ask for there password.

I will stop my rambling now, as thread Intruder @parhamsanMoved platform / OS.

With is definitely not supported with out complications.

Edited by Neminem
Posted

Well,
I understand that cross platforming could create issues, but extracting users data did not bring images back nor the passwords.

Happy2Play,

What if I delete all the users (except the admin) from the new emby server and then add them one by one from the backup (windows) users.db to the new one? Will that work?

please help me out here!!!

Posted

Happy2Play,

I opened both users.db from windows and Unraid.

I see that the password for me (admin), on both windows and Unraid are the same. I also know which user is who.

Will it work if I append the passwords contents (from the windows users.db) to each user to the users.db (for the Unraid) and overwrite it? Does something like this makes sense?

Thanks.

Posted

BTW tried the method I mentioned above and worked like a charm!!!

If anyone is interested I can explain how I did it.

Thanks for the hints @Happy2Play!!!

  • Like 1
Happy2Play
Posted
3 hours ago, parhamsan said:

I understand that cross platforming could create issues, but extracting users data did not bring images back nor the passwords.

To comment on this that is correct as Users have nothing to do with userdata and is a totally different database.  Created Users and their password and images are stored in the users.db while userdata is stored in the userdatas table within the library.db so extracting userdata only affects one database.

Posted

Happy2Play,

For the saved device authentications, does the file authentication.db hold the Devices that were previously added to the Emby server?

Can I use that file to overwrite the Unraid Devices list?

Thanks!!!

Posted

Just to set expectations we don’t recommend attempting to do peace meal partial restores, as we aren’t really testing this. But I get that you have a problem to solve and so you’re going to do what you need to do.

Posted

Luke,

I completely understand but unfortunately when I did a Restore using the plugin, it completely corrupted my library files and made the new server completely unstable.

So I had no no other choice doing a partial restore using the files!

So far I have edited the users.db with the old passwords, and also used the old authentication.db and they are working on the new server!!!

  • Thanks 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...