Git Product home page Git Product logo

Comments (16)

alekdavis avatar alekdavis commented on June 23, 2024

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.

from plexbackup.

mkitchingh avatar mkitchingh commented on June 23, 2024

Backup.log
I have backup logs. It is attached. I don't have a restore log. It output to the powershell window, and it was very basic. It had successes and then indicated it couldn't start plex. No details on why. I can try again on a new machine if needed. The backup files and data were on a secondary hard drive. I put the drive in the new server. It had the same letter, paths, etc. The account was named mkitchin on both machines. I see in the logs, the actual folder path included Matthew Kitchin. I don't have the new machine I was trying to restore to anymore, because I had to scavenge it to fix the old machine. Is it the folder paths and registry hive paths that have to match exactly? I can test some more. I've also updated my backup script file to the latest now.

from plexbackup.

alekdavis avatar alekdavis commented on June 23, 2024

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?

from plexbackup.

mkitchingh avatar mkitchingh commented on June 23, 2024

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

from plexbackup.

alekdavis avatar alekdavis commented on June 23, 2024

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.

from plexbackup.

mkitchingh avatar mkitchingh commented on June 23, 2024

Thanks. I will test that now. PMS started fine for me manually, just not in the restore script. I'm not sure why.

from plexbackup.

mkitchingh avatar mkitchingh commented on June 23, 2024

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.

PS C:\temp> .\PlexBackup.ps1 -Mode Restore -BackupDirPath "\\10.0.10.10\files$\PlexBackups\20240403103015"

NuGet provider is required to continue
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet
 provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\Matth\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running
 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and
import the NuGet provider now?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): y
PlexBackup v2.1.7 (c) Alek Davis
Script started at:
  04/05/2024 12:48:42
Operation mode:
  RESTORE
Backup type:
  DEFAULT
Plex version:
  1.40.1.8227
Backup version:
  1.40.1.8227
Stopping Plex services:
  Plex Update Service
Stopping Plex Media Server process:
  Plex Media Server.exe
Restoring Plex app data folders.
Importing registry key file:
  \\10.0.10.10\files$\PlexBackups\20240403103015\3\55284a6f7b667f3761eb0f017c2d891a.reg
Restore operation completed.
Starting Plex services:
  Plex Update Service
Starting Plex Media Server:
  C:\Program Files\Plex\Plex Media Server\Plex Media Server.exe
RUNAS ERROR: Unable to run - C:\Program Files\Plex\Plex Media Server\Plex Media Server.exe
87: The parameter is incorrect.
 Plex app data size:
  85 files and folders
  0 GB of data
Script ended at:
  04/05/2024 12:49:22
Script ran for (hr:min:sec.msec):
  00:00:39.949
Script execution result:
  SUCCESS
Done.
PS C:\temp>

The file is there, and it will start if I run the command manually.

C:\>dir "Program Files\Plex\Plex Media Server\Plex Media Server.exe"
 Volume in drive C has no label.
 Volume Serial Number is 6C47-87D9

 Directory of C:\Program Files\Plex\Plex Media Server

03/14/2024  02:19 PM        28,645,664 Plex Media Server.exe
               1 File(s)     28,645,664 bytes
               0 Dir(s)   8,346,804,224 bytes free

from plexbackup.

alekdavis avatar alekdavis commented on June 23, 2024

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 -machine to address it, so hopefully if you run it with this parameter, it should fix the problem (see https://github.com/alekdavis/PlexBackup/releases/tag/v2.1.7). But if there store works without any other errors and you can start PMS manually (not via the script), the point is that your restore was successful. You may get the same error when you run the backups, so again =, try adding this parameter and see if it fixes the issue.

from plexbackup.

mkitchingh avatar mkitchingh commented on June 23, 2024

I shutdown the test machine after the restore. I just tried to boot it back up, and it got the most generic error you can imagine. I am able to reproduce it by trying to start plex. All I did on this test machine is install Plex, and stop. I didn't go through full setup wizard after install. See attached pic for the error. I'm just trying to validate that I can use this program to recover Plex after a failure.
image

from plexbackup.

alekdavis avatar alekdavis commented on June 23, 2024

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.

from plexbackup.

mkitchingh avatar mkitchingh commented on June 23, 2024

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.

from plexbackup.

mkitchingh avatar mkitchingh commented on June 23, 2024

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.

PS C:\temp> .\PlexBackup.ps1 -Mode Restore -BackupDirPath "\\10.0.10.10\files$\PlexBackups\20240403103015"
PlexBackup v2.1.7 (c) Alek Davis
Script started at:
  04/08/2024 13:10:33
Operation mode:
  RESTORE
Backup type:
  DEFAULT
Plex version:
  1.40.1.8227
Backup version:
  1.40.1.8227
Stopping Plex services:
  Plex Update Service
Stopping Plex Media Server process:
  Plex Media Server.exe
Restoring Plex app data folders.
Importing registry key file:
  \\10.0.10.10\files$\PlexBackups\20240403103015\3\55284a6f7b667f3761eb0f017c2d891a.reg
Restore operation completed.
Starting Plex services:
  Plex Update Service
Starting Plex Media Server:
  C:\Program Files\Plex\Plex Media Server\Plex Media Server.exe
RUNAS ERROR: Unable to run - C:\Program Files\Plex\Plex Media Server\Plex Media Server.exe
87: The parameter is incorrect.
 Plex app data size:
  137 files and folders
  0 GB of data
Script ended at:
  04/08/2024 13:10:37
Script ran for (hr:min:sec.msec):
  00:00:03.645
Script execution result:
  SUCCESS
Done.

from plexbackup.

alekdavis avatar alekdavis commented on June 23, 2024

Okay, first of all, from your backup log file:

Script started at:
  04/01/2024 04:00:00
Operation mode:
  BACKUP
Backup type:
  7ZIP

Now, from you restore log:

Script started at:
  04/08/2024 13:10:33
Operation mode:
  RESTORE
Backup type:
  DEFAULT

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:

Restoring Plex app data folders.
Importing registry key file:
  \\10.0.10.10\files$\PlexBackups\20240403103015\3\55284a6f7b667f3761eb0f017c2d891a.reg
Restore operation completed.

The fact that it shows that there is hardly any data in the app data folder is also a hint:

 Plex app data size:
  137 files and folders
  0 GB of data

So the first thing to try would be to run restore with parameter -Mode 7Zip. To address error 87, you may want to add parameter -Machine x86 or -Machine amd64 (this would depend on the platform version of the PMS executable, which, based on the fact that the PMS folder is under the Program Files and not Program Files (x86) folder, but it may be a wrong assumption.

from plexbackup.

alekdavis avatar alekdavis commented on June 23, 2024

I added more sanity checks during restore to capture the situation like yours.

from plexbackup.

mkitchingh avatar mkitchingh commented on June 23, 2024

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.

from plexbackup.

alekdavis avatar alekdavis commented on June 23, 2024

Sure. I will close it. Let me know if you run into any issues.

from plexbackup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.