Automating export and import of projects
Overview
You’ll need version 3.0.0 or higher of Project Configurator.
3.7.0 Update: Security vulnerabilities fixed in accordance with our bug bounty program. These vulnerabilities affect all prior versions of Project Configurator up to and including 3.6.2. We strongly advise that you upgrade to version 3.7.0 or later. See the 3.7.0 release notes for more information.
This section explains how to drive Project Configurator from the command line so you can create scripts that export or import complete projects. The method is based on interacting with the Jira server by issuing HTTP requests to concrete URLs. You need a tool that lets you issue HTTP requests from the command line, such as wget or curl. If you are not familiar with wget or curl, it is recommended you first have a look at the manual for these products.
Some examples are provided below. Remember, export and import operations require permission from the system administrator.
These examples have been tested on Ubuntu Linux 16.04, and they use curl and xmllint. Both programs must be installed on the system where you are going to run the scripts; you can install them with the following commands:
apt get update
apt get install curl
apt get install libxml2-utils
In order to execute the scripts provided, copy them to a folder included in your machine’s path for executable files and make them executable.
Script versions 3.7.0 and newer
Download the following .zip file for our latest script versions for Project Configurator 3.7.0 or later:
These scrips were tested for Linux/Unix and MacOS but not for Windows.
The ZIP file contains the following scripts:
Auxiliary scripts
The auxiliary scripts are required by the Import and Export scripts:
wait-task-script
status-checker-script
get-csrf-script
Export script
sh export.sh jira-host-url jira-context-path admin-user admin-password export-file-name export-mode project-key1 project-key2 ... -O export-options
This is an example of an executable script that exports the complete project with key HER:
./export.sh <JIRA_HOST_URL> jira admin admin export.zip -COMPLETE HER
This is an example of an executable script that exports the project configuration of a project with key HER:
Import script
This is an example of an executable script that imports a complete project.
This is an example of an executable script that imports the project configuration of a project with key HER:
This 3.7.0 script version requires that you update the command used to invoke the import/export scripts. If you are upgrading, refer to the usage command at the top of the related scripts. It is also provided as a snippet below.
Script versions 3.6.2 and older
Download the following .zip file for our earlier script versions for Project Configurator 3.6.2 or older:
The ZIP file contains the following scripts:
Auxiliary scripts
The auxiliary scripts are required by the Import and Export scripts:
wait-task-script
status-checker-script
Export script
This is an executable script that exports complete projects. Run the export script using the following command:
Import script
This is an executable script that imports complete projects.
Legacy import script versions earlier than 3.1.10
Import script
Export options
jira-host-url: Host part of the exporting instance base URL, including port if needed (for example, http://my-server:2990)
jira-context-path: Context part of the exporting instance base URL (for example, "jira"). Note that jira-host-url + "/" + jira-context-path equals "Jira base URL" (for example, http://my-server:2990/jira)
admin-user: Admin’s username
admin-password: Admin’s password
project-key [project-key2 …]: Keys of the projects to export, at least one must be provided
export-mode: COMPLETE for complete export or CONFIGURATION for exporting just configuration
export-file-name: Only for COMPLETE export. Name of the exported file; remember it will be left in "projectconfigurator" folder under directory $JIRA_HOME/export (for example 'exported-projects-10-04-2017-zip')
export-options: Additional export options. Each export option must be specified as key=value, preferably enclosed in double quotes.
Parameters | Possible Values | Notes |
---|---|---|
attachmentMode | automatic | Attachments will be included in the exported ZIP file (This is the default option) |
manual | You’ll need to copy the source Attachments to the target before launching a complete import. | |
filterUnusedCF | true | This parameter is deprecated. It is kept for backward compatibility with versions 1.3.0 and earlier of the app. It is equivalent to setting "filterCFMode=filterUnusedCFStrict". |
filterCFMode | exportAllCF | Export all custom fields. |
filterUnusedCFStrict | Filter custom fields unused by the exported projects, as explained Filtering Unused Custom Fields, but without taking into account whether there are issues in the project with values for that custom field. This option is deprecated, it is kept only for backwards compatibility with app versions older than 1.5. | |
filterUnusedCFExtended | The default. Filter custom fields unused by the exported projects, as explained in Filtering Unused Custom Fields. | |
userExportMode, groupExportMode | fullExport | Export all (users or groups) |
ignoreInvalid | The default. Export all but users or groups not found or not valid | |
doNotExport | No user or group will be exported. | |