Amazon festival offer

Tuesday 17 April 2012

How to take the backup of jasperreport server?

Using these export and import utilities you can take the backup of Jasper server.
It will be very helpful if you are uninstalling Jasper server and wants to install newer version of jasper server or if you are trying to duplicate the Jasper instance in another machine, So you do not need to create again all the reports from starting.
 
There are two batch file in Buildomatic directory of Jasper server.

1. export.bat (js-export.sh for Linux) which takes the backup of Jasper server.

2. import.bat (js-import.sh for Linux) which import all the backup files of Jasper server.

means using these two batch files you can import all the reports of jasper server to another instance of Jasper server.

How to run js-export.bat file:-

Go to the command prompt and find the path of Buildomatic directory in Jasper Server.
1: If you want to take the whole Jasper server repository backup

For windows machine : - 

<js-install directory>buildomatic>js-export.bat --everything --output-zip backup.zip

For linux machine : -

<js-install directory>/buildomatic>sh js-export.sh --everything --output-zip backup.zip

2: If you want to take the backup of any specific directory 

For windows machine : -

<js-install directory>buildomatic>js-export.bat --output-zip backup.zip --uris /Resource_id_of_directory

For linux machine : -
 
<js-install directory>buildomatic>sh js-export.sh --output-zip backup.zip --uris /Resource_id_of_directory

(How to find the Resource id of any directory:-
   Right click on the any directory of the jasper server repository and select property and find the "Resource Id")

3:  You can also take backup of any specific report

<js-install directory>buildomatic>js-export.bat --output-zip backup.zip --uris /Resource_id_of_report

Resource id of the report:- Resource id is always written in red color when you open any report

All the backup files will generate inside the buildomatic directory of Jasper server.

How to run js-import.bat file:-

Go to the command prompt and find the path of Buildomatic directory in Jasper Server.

For windows machine : -
 
<js-install directory>buildomatic>js-import.bat  --input-zip backup.zip


For linux machine : -

<js-install directory>buildomatic>sh js-import.sh  --input-zip backup.zip
 
It will create the whole Jasper server repository on your Jasper serve, but if the directories are already existing it will not update those directory, so delete the directory from jasper server and run the import command.



14 comments:

Anonymous said...

Thanks for the info,but could you list out the possible changes in the config files it would be great,I am trying to migrate report from UAT to production.
Any inputs would be great

sharad-gupta said...

Just take the whole backup of your UAT Jasper server as a zip file using js-export command and copy this backup file in the buildomatic directory of the production jasper server and run js-import command.

Svyatogor said...

Thank you! I was desperately looking for this.

Anonymous said...

Thanks Brother.. Saved my time.

Anonymous said...

Pretty! This has been a really wonderful post. Many thanks for providing this information.



Here is my site backup

Anonymous said...

This is what i was looking for...Great post...Good work bro..

Anonymous said...

Aw, this was an incredibly nice post. Taking the time and actual effort to make
a top notch article… but what can I say… I put things off
a whole lot and don't manage to get anything done.



Visit my site; jeu candy crush

Anonymous said...

This is really helping. Thanks a lot!!

Suryakant Soni said...

Hi Sharad,

Can we delete the Content Resource" of Jasper Server from Command line?

Can we import the exported "Content Resource" (using js-import command) to a specific folder in Jasper Repository?

Thanks,
Soni

sharad-gupta said...

@Suryakant
No you can not delete Resource id's of contents but yes you can import the resources to a specific folder by editing .XML files , you have to just change the path of the folder in folder tag.

Unknown said...

How can I schedule the weekly import process of repository??
again the name of the file should be xyz_dd/mm/yyy w.r.t specific export on particular day.

Unknown said...

How we can schedule the weekly export of jasper repository ??, with the new name to export file, every time the export is generated. e.g filename_dd/mm/yyy with respective date on which export was taken.

Unknown said...

Good One

Unknown said...

Good One