If you installed JasperReports Server from the binary installer, the import-export utilities were configured by the installer. If you installed the WAR file distribution, you must configure several files before you can use the import-export utilities.
Another option is to use the Alternate Import-Export Scripts because they do not require any configuration, regardless of the installation method.
1. | Depending on the database you use, copy the installation configuration file: |
from: <js-install>/buildomatic/sample_conf/<database>_master.properties
to: <js-install>/buildomatic/default_master.properties
2. | Edit the default_master.properties file to set values specific to your installation. For more information about the settings in this file, see the JasperReports Server Installation Guide. |
Oracle users can set the sysUsername and sysPassword to the same name as dbUsername and dbPassword in the default_master.properties. The system user name and password are not required because js-import and js-export do not make changes to database schema. |
3. | Run the following command: |
js-ant clean-config gen-config
This command will generate the following files with the values you added to the default_master.properties file:
• | <js-install>/buildomatic/build_conf/default/js.jdbc.properties |
• | <js-install>/buildomatic/build_conf/default/js.quartz.properties (only for DB2 and PostgreSQL) |
4. | Make sure the JDBC driver for your database is located in the following folder: |
<js-install>buildomatic/conf_source/iePro/lib
If necessary, you can find links for downloading JDBC drivers from the Jaspersoft Community website:
http://community.jaspersoft.com/wiki/downloading-and-installing-database-drivers
Alternate Import-Export Scripts
Regardless of your installation method, JasperReports Server provides a third way to run import-export commands. Buildomatic is another command-line script that is based on the Apache Ant tool to automate installations. It includes targets (sub-commands) to perform import and export operations with the same options as the scripts. The following examples compare the two commands:
Shell Scripts: | js-export.sh --everything --output-file=js-catalog-exp.zip |
Buildomatic: | js-ant export-everything -DexportFile=js-catalog-exp.zip |
Both types of scripts are located in the <js-install>/buildomatic folder.
Running Import from Buildomatic
The import target for ant has the following syntax:
Windows: | js-ant import -DimportFile=<filename> [-DimportArgs="<import-options>"] |
Linux and Mac OSX: | ./js-ant import -DimportFile=<filename> [-DimportArgs="<import-options>"] |
The imported file is handled as a ZIP archive if its name ends in .zip, otherwise it is handled as a directory. The importArgs argument is optional and can contain more than one import option. On Linux, all double quotation marks (") must be escaped with a backslash ().
When performing a large import using js-ant, the server should be stopped (or put into a mode with reduced load) to avoid issues with caches, configuration, and security. |
The following examples are typical import commands on Windows:
The following examples are typical import commands on Linux:
Running Export from Buildomatic
The export target for ant has the following syntax:
Windows: | js-ant export -DexportFile=<filename> -DexportArgs="<export-options>" |
Linux and Mac OSX: | ./js-ant export -DexportFile=<filename> -DexportArgs="<export-options>" |
The export file format is a ZIP file or a set of files under a new directory name. If you specify the .zip extension for your output filename, a ZIP archive is created automatically. Otherwise, a directory with files and sub-directories is created as a uncompressed set of files.
The exportArgs argument requires double quotation marks (") and can contain more than one export option, as shown in these Windows examples:
On Linux, all double quotation marks (") and other characters, such as the vertical bar (|), which separates login user and organization names must be escaped with a backslash (). In addition, when listing user names, enclose the list in single quotation marks ('), as shown in this Linux example:
Recommended Comments
There are no comments to display.