-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore didn't work too well for me #87
Comments
Do you have log files from your last backup and restore? Can you share? How did you move the backup files to the new server? What was the error? Did you perform restore using the same account as on the old server? It's really hard to guess what went wrong based on your description, but I have done a few restores myself and people report not having any issues, so can't really say what happened in your case. |
Backup.log |
The backup log looks fine, but the restore log would be more helpful. Now with your new machine gone, and no log, I'm not sure what we can do. Do you have at least the full error message you got on the failed attempt to restart PMS? |
I don't have it. It was very short and generic. I can try to reproduce it. What is it that has to match between the old an new machines? The login name, full name, user directory path, etc.? |
The restore process is not terribly complex. I do not think anything really needs to match. There are two things being restored: (1) PMS app data files and (2) registry key(s). The important step is that as for the backup step, during restore you need to be logged in as the same account, under which PMS runs. By default, it assume that the files (1) will go the the default PMS APPDATA folder. You can change it, but it must match what you have in the PMS config. So, once the files get copied, the next step is registry restoration. The registry file should point to the currently logged in user, so as long as you run it under the righ account, it should be imported into the correct hive, even regardless of user ID. The PMS process should not be running. A normal sequence would be: install PMS, launch it to make sur it runs, then run restore (which will stop PMS and restart it at the end). So if PMS cannot start after restore, I would check logs (under the PMS APPDATA folder), Windows event log to see if there are descriptions of errors. |
Thanks. I will test that now. PMS started fine for me manually, just not in the restore script. I'm not sure why. |
I tried it on a test machine for the restore, and I get the same error on starting PMS. PMS is a fresh install running as my user account.
The file is there, and it will start if I run the command manually.
|
Ah, the infamous error 87. If you do a search in the issues, you will find a number of complaints about getting it when trying to restart PMS (mostly after backup, but for restore, the idea should be the same). It is apparently due to a bug in the OS caused by some hot fix. I added a parameter |
Without being able to poke around your system, it's hard to say what went wrong. I'm not sure what you mean by "All I did on this test machine is install Plex, and stop. I didn't go through full setup wizard after install." Did you not complete the Plex installation? As I said before, the sequence is to (1) Install Plex, (2) launch PMS, (3) run restore script. The restore process is simple: it stops PMS, copies app data files, imports registry, and starts PMS. Now, if you change something (like use 64-bit Plex on a new system, when you used 32-bit Plex on the old system, or change paths saved in the registry, so after restore it gets them wrong), I can see how this can cause issues. I would check the registry key to make sure it point to correct folders, check app data folder, make sure Plex has access to the folder (meaning account under which Plex runs does), and go from there. I have done this multiple times (but not recently), and so did many others, and this is the first time I hear about the issue, so I'm not sure what might have caused it. |
I mean took a plain test machine, and installed Plex. I finished the install. It then tries to start some additional setup and customization questions after you launch Plex the first time. I didn't complete that part. I meant I stopped configuring Plex at that point. I didn't change anything. Both are 64 bit Windows 11 machine. I don't think I have done anything out of the ordinary, and certainly didn't want to do anything special. I will keep poking around. |
It was this registry key. "LocalAppDataPath" The user directory was slightly different on the old computer vs. the new. I fixed that registry key, and Plex starts. It still seems to have non of my config though. The libraries aren't there. Manage Libraries shows no libraires at all. Restore appears clean. See below. I also tried using the -machine flag you mention, but I must not understand where I am supposed to put it. I tried it a command line argument to the restore, and that failed.
|
Okay, first of all, from your backup log file:
Now, from you restore log:
If you use 7zip to back up, you need to use 7zip to restore. Otherwise, the script will not find the backup files and will only restore the registry, which we can observe by noting that it did not restore any folders:
The fact that it shows that there is hardly any data in the app data folder is also a hint:
So the first thing to try would be to run restore with parameter |
I added more sanity checks during restore to capture the situation like yours. |
Got. That makes sense. I didn't know I had to specify that on the restore. I'm sure that is the problem. I'm going to have to hold off testing again. Every time I do this, it is kicking my production plex server out of remote access and causing an issue for my remote user (son at college). I can close this unless you want me to do anything else. |
Sure. I will close it. Let me know if you run into any issues. |
I have the latest Plex 64 Bit on Windows with Plex Pass. PlexBackup.ps1 was PlexBackup v1.5.3. Backup command is
powershell -file c:\script\PlexBackup.ps1 -Type 7zip -BackupRootDir D:\Files\PlexBackups -Log -Errorlog
Backups look like they work well, but I have have never tested them more than looking at the contents. Server failed today, and I started migrating to a new server. I installed the latest Plex 64 bit, and downloaded the latest PlexBackup.ps1. I ran the restore command
PlexBackup.ps1 -Mode Restore -BackupDirPath "d:\Files\PlexBackup\<latest bakup dir"
It seemed to work properly, except it was unable to start plex. It had an error that included the path to the plex media server.exe file, which was correct. I launched plex, and none of my libraries were there. The old server was still there with libraries with warnings on them. All the media files were on the new server in the exact same location. I deleted the old server from authorized devices. I tried everything I could think of, but nothing seemed to work. I couldn't get all my old libraries and settings added to the new server. After a few hours, I changed course and repaired the old server. Moving the hard drives to a similar device got me up and running again. Obviously my backup plan isn't working. I backup my media separately, but my hope was after putting the media in the correct place, I could just restore everything with this script. Any ideas?
The text was updated successfully, but these errors were encountered: