How to perform a command line restore of a backup on a Cloud Backup (S3) device or a Local Backup device (which are both "FPI" backup types), which will allow multiple restores at the same time to be run (instead of a single), and which can also be used to see errors or debug messages that a normal restore log can't show. This method can also be utilized if a normal GUI restore does not work, for instance if you ever run into this restore job error log scenario (where 1 file is selected but 1 file can't restore), then you may want to try the command line restore method next:
To do that read the following how-to instructions:
If you only need to restore a single FPI backup (which could be a Hybrid enabled "Local Backup" device backup entry in that case, which is compatible to restore with this command line restore method, but you would just need to be careful they when you are in the client Restore tab that you select the "HY" restore index entry (that specifically states "HY" at the very start of the "Location (Device)" column value string text, and would contain the actual "S3" device name in it at the end of that column value string text as well, for the Hybrid (S3) entry for the backup to restore in that case, to generate the .json file with, if you want it to try to restore from S3 directly, instead of the non "HY" restore index entry in that case, which would attempt to only restore from the 'Local Backup' FPI device in that case, not from the Cloud Backup (S3) FPI device in that case, so just realize that if the FPI backup in question was a Hybrid enabled backup job in that case) then you only need to create and save one restore job script via the client UI, but if you have multiple restores to do simultaneously (or in some ordered fashion, where you will wait for one to complete before running the next one in a set order), even from more than 1 x Cloud Backup (S3) device, or from more than 1 x Local Backup device, or from 1 x Cloud Backup (S3) and 1 x Local Backup device, in that case you would need to first use the client UI to create all of those restore job scripts, before you would be able to run them either simultaneously or separately from each other via the command line. Just keep that in mind that all of the restore jobs will need to be created first, and run for at least 1 second before you either manually stop the job or you wait for the error to come, before you can attempt to run the job again via the command line method, which is the 3rd step below (and you will need to repeat that 3rd step if you do have multiple restores to perform, on more than 1 backup to restore in that case, with this alternate command line restore method).
1. Add or enable the 'KeepJobJson=1' flag in the client 'nsconfig.ini' file. Do that first before continuing though, otherwise you won't be able to see the .json filename at all for any backup jobs that you do run the normal way (either manually in the client or on the schedule in the client, and then stop after 1 second, to get that backup job .json file generated and permanently stored in the FPI folder.
2. Start the client and go to the Restore tab and locate the backup that you want to restore, in the restore index list, and once you are done selecting that single backup to restore, and you select the items to restore from that single backup, along with the target and other such restore options, and optionally (meaning that this step is not required, but it may be advisable to do so because it will allow you to see the exact structure of your file selection in the "[select]" section of text in the saved .nbk script file, as well as the target and the job options that you chose for this restore, in plaintext, and if you want to schedule this restore job for some reason then it is required to save the restore job to a .nbk script file in that case) you can also use the Save Restore job function in the client's top toolbar while still in that Restore tab, there will be a Save Restore Job and a Save As Restore Job functions to utilize there, choose one and then save the restore job as a .nbk script file, which will by default store into the default 'C:\ProgramData\NovaStor\NovaStor NovaBackup\UserScripts\Restore\' folder.
3. Then run the restore job one time the normal way via the client GUI (but this time with the KeepJobJson=1' flag in the client 'nsconfig.ini' file), either via a manual restore job run or via a scheduled job run if you did end up scheduling the restore job that is (which would be rare to see for the latter). You only need this restore job to attempt to run the normal way via the GUI, and it can either fail very quickly, if it was failing prior for you, in a prior attempt before you had enabled the 'KeepJobJson=1' flag in the client 'nsconfig.ini' file, which as I stated in Step 1 is required to generate the restore job .json file, or you can choose to stop the restore job manually as long as it has run for at least 1 second in this Step 3; and that should be enough to create the restore job .json file in the FPI folder.
4. Use Windows Explorer to navigate to the default FPI folder 'C:\ProgramData\NovaStor\NovaStor NovaBackup\FPI\' (and if the client does has a custom 'FPIDataDir' variable value in place then you will need to know what that folder is by viewing the variable value in the nsconfig.in file first) and inside the "root" FPI folder will need to be at least one FPI device folder name that running backup jobs to any FPI device type in the past would have created, based on the exact "Device Name:" parameter value that you had specified when creating that device in the client "Device" tab already. An example folder for a standard commonly seen "NovaBACKUP Cloud Storage" FPI device type (an "S3" or "NovaBACKUP Cloud" device in that case) would be "C:\ProgramData\NovaStor\NovaStor NovaBackup\FPI\NovaBACKUP Cloud Storage\" in that case there. And the files inside that named device folder, per FPI device in that case, which each have their own named folder under the FPI folder name, are files in the above noted default folder, that contain the word "backup" and have a ".json" file extension on them (hint you will want to disable the Windows Explorer option named "Hide known file extensions", to be able to see the file that .json extension), inside the program folder: "C:\ProgramData\NovaStor\NovaStor NovaBackup\FPI\NovaBACKUP Cloud Storage\". You will need to know the entire full complete path to the folder and backup_.json file in question to use this command line restore method.
5. With that restore job .json file path already recorded (written down in notepad, along with the Backup "Name" value to match it), you can utilize this alternate command line restore method to process that restore (and you can even have multiple restores going at once, which is an advantage of this command line method):
6. Start an Administrator Command Prompt and perform this first command in that cmd prompt session, to change folder into the standard app folder:
cd "C:\Program Files\NovaStor\NovaStor NovaBackup\"
7. Via that same cmd prompt session, you will then run the engine.exe with the full complete path to the restore_.json file specified as the input file parameter in the command, which is the actual restore job .json file name where it was originally created in that case, inside the FPI folder in that case, that you identified the file path and file name already on for the restore job that you ran before that just created that restore job .json file to utilize with the alternate command line restore method here, as an example for you:
engine.exe "C:\ProgramData\NovaStor\NovaStor NovaBackup\FPI\NovaBACKUP Cloud Storage\restore_example.json"
The full complete path + restore job .json input file will need to be surrounded in double quotes (like the above last example shows).
Note: In the above example command for a restore job .json file as the input value, please take notice that the restore job .json file exists in a quite long standard folder path where it was originally created at, but the engine.exe application exists in a different folder then that, which has no standard current user "Path" statement value entry in Windows, so you would need to run that .exe directly from that program app folder in that case, which is how these instructions are written. Because of this you will be required to surround the input .json file in " double quotes, as already shown in the example above.
8. After specifying the "engine.exe restore input .json" command, then you will press the enter key at the end of the example command above and it will start the restore job operation, based on all of the saved .json parameters, to the target folder that you had specified in the restore job options that you had utlized for that backup job scrip, which then generated the restore job .json file from that, as the input file to utilize for this command line restore in that case. The status can be updated by pressing the enter key <CR> once again after the restore starts to show some output to you on screen, or if it clears the screen and the command is still running. Once the command is done you can perform a select all inside the Command Prompt session window, with CTRL-A or otherwise in the File menu of that cmd prompt session, and that will allow you to paste all of that selected text into a text file, to use for troubleshooting or submitting to a ticket as a .txt file then, if it had a problem, etc. There will be no client Logs tab entry created for this type of command line restore method in that case, and that is why I mention that you may want to copy all of the backup text in that cmd prompt session for that single restore attempt to be 100% sure it did complete without a problem or error, which can help our support team as well to know about that (since otherwise we won't be able to see the log from that restore attempt if you do end up using this alternate command line restore method).
9. Using this command line restore method (in Step 3. and in Step 1 just by you having enabled the 'KeepJobJson=1' flag in the client 'nsconfig.ini' file as a step) does expose the full account (and S3 endpoint) details of the S3 or Local FPI device however (in plaintext in the .json input file), including the current device encryption key, so I could see why we wouldn't want to make that knowledge public. It also leaves the .json files in place forever, for any new jobs that run, if the end user or we forget to remove the flag at the end, as the last step. This is the warning to remove the 'KeepJobJson=1' flag in the client 'nsconfig.ini' file as it is security risk to leave it in place, and it will also leave .json files each time in the FPI folder which won't be cleaned up, and it is a critical Step 9 for you to complete in that case (unless it is a non-customer internal machine you are testing this alternate command line restore method on).