Jump to content

Can't login after manual backup/restore due to disk swap


charlyp
Go to solution Solved by charlyp,

Recommended Posts

Hi,

This topic is a bit old, but I just found myself with a similar problem today.

I had to swap the main disk from my TerraMaster NAS for a bigger faster one. Following the instructions on How to Backup Manually, I backed up the Emby files, then I replaced the disk, I reinstalled the TOS —the medias are located on different disks in the NAS— then I reinstalled Emby from the NAS Applications panel.

I let the Emby wizard take me to the dashboard (setting up the basic information such as languages), then I shut it down (from the Emby dashboard). I replaced the new Emby files with the ones I previously backed up, then I restarted Emby. Now, when I go to Emby, I get all the usernames to display and mine even shows my avatar so it looks like Emby finds the correct files.

The problem is that I  no longer can get in, I get an "invalid username or password" error, both with my username and with the admin username I originally created on the old Emby —I haven't tried with the other users but I guess it'll have the same effect (and I don't know their passwords, anyway).

So I tried using the "Forgot password" option, but I couldn't get anywhere with it. The process seems to work OK, it creates the PIN in the file "passwordreset.txt" but when I enter the PIN in the "…/forgotpasswordpin.html" page, nothing happens. I don't get an error after submission, it just sits there. When I submit it a second time, it says "Invalid PIN" (I guess the PIN is valid once only).

It seems I'm almost there, so can you please help?

Thanks,

Ch.

Edited by charlyp
Link to comment
Share on other sites

Hi,

I first posted this message in an existing similar thread, but as it's dated from 2018 and in the Windows section, I thought I'd better repost it here in the TerraMaster section where it belongs. Sorry for the double post!

I had to swap the main disk from my TerraMaster NAS for a bigger faster one. Following the instructions on How to Backup Manually, I backed up the Emby files, then I replaced the disk, I reinstalled the TOS then I reinstalled Emby from the NAS Applications panel —just for information,  the medias are located on different disks in the NAS.

I let the Emby wizard take me to the dashboard (setting up the basic information such as languages), then I shut it down (from the Emby dashboard). I replaced the new Emby files with the ones I previously backed up, then I restarted Emby. Now, when I go to Emby, I get all the usernames to display and mine even shows my image profile so it looks like Emby finds the correct "old" files.

The problem is that I can no longer get in, I get an "invalid username or password" error, both with my own username and with the admin username I originally created on the old Emby —I haven't tried with the other users but I guess it'll have the same effect (and I don't know their passwords, anyway).

I tried using the "Forgot password" option, but I couldn't get anywhere with it. The process seems to work OK, it creates the PIN in the file "passwordreset.txt" but when I enter the PIN in the "…/forgotpasswordpin.html" page, nothing happens. I don't get an error after submission, it just sits there. When I submit it a second time, it says "Invalid PIN" (I guess the PIN is valid once only).

It seems I'm almost there, so can someone please help?

Ch.

Link to comment
Share on other sites

Happy2Play

Can you post a server log showing that process?

Since you moved/replace existing folder does that possibly change folder permission on this platform?

 

Link to comment
Share on other sites

Thanks for your reply @Happy2Play

I've attached the most recent lines of the embyserver log. 

There's a ReadOnly error about SQLite so you might be right about file privileges. What should the privileges be on the files I copied from the old Emby?

Ch.

embyserver.txt

Link to comment
Share on other sites

Happy2Play

Sorry I don't know these platforms.

Yes unfortunately if it is a permissions issue and you are unable to figure it out you will have to start with a new database.

SQLitePCL.pretty.SQLiteException: ReadOnly: attempt to write a readonly database

Note I am guessing it will be more than just permissions on the just the database, I would suspect potentially the entire folder.

Are there .db-shm and .db-wal files in /home/emby/data folder with Emby shutdown?

As you can see this has happened to others.

Showing results for '"ReadOnly: attempt to write a readonly database"'. - Emby Community 

Edited by Happy2Play
Link to comment
Share on other sites

Well since I can't get into Emby to shut it down properly, I don't know but there are .db-shm and .db-wal for all .db files in the "data" folder. Since Emby is running, I guess it's normal?

Also, everything seems to be okay Emby-wise —except the connection problem— because I use the auto Organization plugin and this morning, the episodes I put into the watched folder were moved into their correct "Series/xxx“ folder. That means the plugin still works as expected and Emby got the path alright (after the migration) and has no problem to read and write.

Since I can't shut down Emby from its dashboard, should I terminate its process then delete all the .db-shm and .db-wal from the data folder, then start Emby again? Could it corrupt Emby even more?

Ch.

Link to comment
Share on other sites

On 2/28/2022 at 3:48 AM, charlyp said:

Well since I can't get into Emby to shut it down properly, I don't know but there are .db-shm and .db-wal for all .db files in the "data" folder. Since Emby is running, I guess it's normal?

Also, everything seems to be okay Emby-wise —except the connection problem— because I use the auto Organization plugin and this morning, the episodes I put into the watched folder were moved into their correct "Series/xxx“ folder. That means the plugin still works as expected and Emby got the path alright (after the migration) and has no problem to read and write.

Since I can't shut down Emby from its dashboard, should I terminate its process then delete all the .db-shm and .db-wal from the data folder, then start Emby again? Could it corrupt Emby even more?

Ch.

Can you just restart the NAS or do you have Emby set to autostart with it?

Link to comment
Share on other sites

  • Solution
charlyp
On 3/1/2022 at 5:40 PM, Luke said:

Can you just restart the NAS or do you have Emby set to autostart with it?

Sorry for the late reply, the notification for your message was seen as junk by Mail —not the previous ones, tho…

Yes, I can restart the NAS and I did this twice, but that didn't fix the problem.

I found out last night what was wrong: when I copied the backed up files (from the previous disk), I copied them as admin and I didn't think to change their owner, so they belonged to root:root. As (recursively) changed that to emby:emby and I was able to log in. Maybe you could amend the "Backup manually" section with something about file owners?

However, the libraries were there but they looked emptied (0) and as soon as I set one path back, Emby removed everything, showing no library at all (the log shows this for everything: "Removing item from database, Type: Folder, Name: series fr, Path: /mnt/clump/series fr"). I shut down Emby and copied the backup files again, in case the problems I just had did something wrong somehow, but the same thing happened.

So I set the path to the first library again and this time, it stayed and the scan started. Fortunately, all "seen" flags remained so that's very cool. Still, some files were incorrectly identified (like when I first added them) and I had to re-identify quite a lot of 'em. Emby also lost the sorting titles (which is logical, I guess).

Anyway, after some cleaning, everything's fine as it was before, so I'm very happy 😃 

Thank you guys for your support.

Ch.

Edited by charlyp
  • Thanks 1
Link to comment
Share on other sites

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...