Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
jblomqvist
Specialist
Specialist

Batch file for restoring a backup of NPrinting? Need to run the restore job using Windows Task Scheduler

Hi,

Here in our business project in Sweden we have performed a back up of NPrinting.

We have the zip file. Itbis about 187GB in size.

But it seems like it will take a few hours to do the restore having attempted it from command line.

Is there a batch file that can do the job? The idea being we populate the code in the batch file with the location of the zip file and password and let it run using Windows Task Scheduler.

We can stop and start the services manually but the middle part where the command line is cd to the folder and then restore, we were wondering whether that can be done using  a batch file.

Labels (2)
1 Solution

Accepted Solutions
Ruggero_Piccoli
Support
Support

Hi,

You can insert the command you wrote in the Windows shell in a .bat file and then run the batch file. The password of the repository is in the command so it will not ask info interactively. 

In my latest answer to this question https://community.qlik.com/t5/Qlik-NPrinting-Discussions/What-exactly-is-backed-up-when-backing-up-N... I listed all the content of the .zip file generated by the backup procedure. This will help you to evaluate if you have unused stuffs that are keeping the size huge.

Please remember that you can do the restore only on another instance of exactly the same version of Qlik NPrinting. 

Best Regards,

Ruggero

 



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.

View solution in original post

3 Replies
Ruggero_Piccoli
Support
Support

Hi,

You can insert the command you wrote in the Windows shell in a .bat file and then run the batch file. The password of the repository is in the command so it will not ask info interactively. 

In my latest answer to this question https://community.qlik.com/t5/Qlik-NPrinting-Discussions/What-exactly-is-backed-up-when-backing-up-N... I listed all the content of the .zip file generated by the backup procedure. This will help you to evaluate if you have unused stuffs that are keeping the size huge.

Please remember that you can do the restore only on another instance of exactly the same version of Qlik NPrinting. 

Best Regards,

Ruggero

 



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
jblomqvist
Specialist
Specialist
Author

Hi @Ruggero_Piccoli 

Many thanks for replying.

So would the batch file essentially contain only the two commands below?

cd C:\Program Files\NPrintingServer\Tools\Manager

Qlik.Nprinting.Manager.exe restore -f C:\NPrintingBackups\NP_Backup.zip -p "C:\Program Files\NPrintingServer\pgsql\bin" --pg-password secretPassword

And save this in a .bat file format and let the Task Scheduler run it?

I got the commands from this article: https://community.qlik.com/t5/Knowledge-Base/How-to-BackUp-and-Restore-Qlik-NPrinting-Repository-Dat...

We would stop the necessary services first, then let the .bat file run via task scheduler.

Wait for it to finish.

And then start the services as per the URL guide above.

We have ensure the versions of NPrinting are the same 🙂

 

Ruggero_Piccoli
Support
Support

Hi,

In the .bat file you can also insert the commands to stop the services and re- start them after the backup creation. 

See the following example:

net stop "Qlik NPrinting Audit Service"
net stop "Qlik NPrinting Engine" 
net stop "Qlik NPrinting Scheduler"
net stop "Qlik NPrinting Web Engine"
net stop "Qlik NPrinting License Service"
net stop "QlikNPrintingMessagingService"

C:\Program Files\NPrintingServer\Tools\Manager\Qlik.Nprinting.Manager.exe backup -f C:\NPrintingBackups\NP_Backup.zip -p "C:\Program Files\NPrintingServer\pgsql\bin" --pg-password YourPassword

net start "Qlik NPrinting Audit Service"
net start "Qlik NPrinting Engine" 
net start "Qlik NPrinting License Service"
net start "Qlik NPrinting Scheduler"
net start "Qlik NPrinting Web Engine"
net start "QlikNPrintingMessagingService"

 Note that I stop the services in the correct order to avoid interactive questions on the shell. I placed the full path of the .exe instead of the cd so, at the end of the script, the console will still be on the original folder.

You must execute/schedule the script as administrator.

I supply this script only for training reasons and without any warranty ;-).

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.