How do I safely restore from backup?

This page applies to Risk Register for Jira Data Center and Jira Server

When you restore from a Jira backup, custom fields in the source Jira instance are re-created in the target Jira instance, but with different IDs. Also restored is a database table that contains Risk Register's internal configuration, which references particular custom field IDs. You therefore end up with Risk Register's internal configuration 'pointing to' custom fields by IDs that don't exist in the target Jira instance.

Step-by-step guide

Here's what you need to do to fix the problem. Unfortunately, it involves manual changes to the contents of a database table; and in the future we may offer a way to do this through the Jira user interface, but for now we have to break out some SQL.

Risk Register's internal configuration table is named AO_A29AEA_CONFIG. It has just two columns: ATTR and VALUE.

The ATTR column refers to the following attributes:

Configuration attributes
"RISK_ISSUE_TYPE_ID"
The id of the issue type that we're using as the type for risk issues.
We're keeping this in the database because that protects us from problems if the user later changes the name of the issue type.

"ANALYSED_STATUS_ID"
The id of the status that indicates that a risk has been analyzed; that is, it's probability and impact have been specified.

"CLOSED_STATUS_ID"
The id of the status that indicates that a risk has been closed.

"OPEN_STATUS_ID"
The id of the status that indicates that a risk has been created, but not yet analyzed.

"TREATED_STATUS_ID"
The id of the status that indicates that a risk has been treated; that is, it's treatment has been specified.

"RISK_SCREEN_SCHEME_ID"
The id of the screen scheme that we use for risk issues.

"PROBABILITY_FIELD_ID"
The id of the probability custom field.

"EXPOSURE_FIELD_ID"
The id of the exposure custom field.

"IMPACT_FIELD_ID"
The id of the impact custom field.

"CONTINGENCY_PLAN_FIELD_ID"
The id of the contingency plan custom field.

"REALIZATION_FIELD_ID"
The id of the realization custom field.

"RESIDUAL_EXPOSURE_FIELD_ID"
The id of the residual exposure custom field.

"RESIDUAL_IMPACT_FIELD_ID"
The id of the residual impact custom field.

"RESIDUAL_PROBABILITY_FIELD_ID"
The id of the residual probability custom field.

"TREATMENT_FIELD_ID"
The id of the treatment custom field.

"TREATMENT_PLAN_FIELD_ID"
The id of the treatent plan custom field.

"TREATMENT_LINK_TYPE_ID"
The id of the issue link type that represents risk treatment.

"WORKFLOW_NAME"
The name of the workflow that is recommended for use with risk issues.

"EMPTY_CELL_FILL"
Governs the appearance of empty cells in the risk matrix. Empty cells are those that don't contain any risks.

"ORIENTATION"
Whether the matrix shows impacts as rows and probabilities as columns, or the other way around.

"USE_SLIDERS"
Whether to use slider controls to edit risk assessments.


To update the value for a particular attribute, you execute SQL like this:

Updating the configuration table
UPDATE AO_A29AEA_CONFIG 
SET VALUE="99999" 
WHERE ATTR="RISK_ISSUE_TYPE_ID"


To find the ID of a custom field in the target Jira instance, you can either:


a) Hover over the EDIT menu item for the custom field in Jira's administration area;

     or...


b) Get a JSON file of all of the custom fields in Jira, including their IDs.

To get a JSON file of all of the custom fields in Jira, you can run a curl command like this:

curl -H -k -u username:password -H 'Content-Type: application/json' -o 'cf.json' -X GET http://jiracontext/rest/api/2/field


Of course, you'll need to use a valid username:password, and use the correct context path for your Jira instance. For example, here's how I go the custom fields in a Jira instance at https://example.com/jira using user 'admin' with password 'admin':

curl -H -k -u admin:admin -H 'Content-Type: application/json' -o 'cf.json' -X GET https://example.com/jira/rest/api/2/field


The output will contain JSON objects of this form:

{
    "id": "customfield_10005",
    "name": "Residual Exposure",
    "custom": true,
    "orderable": true,
    "navigable": true,
    "searchable": true,
    "clauseNames": [
        "cf[10005]",
        "Residual Exposure"
    ],
    "schema": {
        "type": "any",
        "custom": "com.projectbalm.riskregister.riskregister-jira:exposure-cf-type",
        "customId": 10005
    }
}


Once you've updated the contents of the AO_A29AEA_CONFIG table, you should re-run the Jira indexer.