Migrating from Jira Cloud to Jira Server/Data Center

This article explains the steps required when migrating a Jira Cloud instance to Jira Server/Data Center when you were using JMWE workflow extensions on your JIRA Cloud instance. 

Background:

Because of the way Atlassian's Connect framework is implemented, workflows extensions (validators, conditions, and post-functions) provided by add-ons are incompatible between Jira Server/Data Center and Jira Cloud. The entire JMWE configuration is contained within the workflows themselves. So you need to take a backup of your entire Jira Cloud instance, identify the workflows and transitions that use JMWE workflow extensions, and fix them.

See here for the https://innovalog.atlassian.net/wiki/spaces/JMWE/pages/1555300353.

Migrating workflows

Before you begin fixing your workflows, publish all your workflows to avoid duplicate work (between the draft and corresponding published workflow)

Step 1 - Backup the Cloud instance and open the XML file

  1. Using JIRA's XML backup utility backup your entire Jira Cloud instance for server.

  2. Unzip the backup.

  3. Find the entities.xml file.

  4. Open it in an editor that supports very large files.

Step 2 - Identify workflows and transitions using JMWE post-functions

At the end of this step, you will create a table with the workflow name and the transition names of all the workflows that contain JMWE post-functions.

Post-function Name

Transition Name

Workflow Name

Post-function Name

Transition Name

Workflow Name

 

 

 

 

  1. Find the text "DelegatingPostFunction"

  2. Right above the search under the “full.module.key” find the post-function name

  3. Write down the post-function name in the table

  4. Work your way up on the file from the line that contains "DelegatingPostFunction" to find the name of the transition on which the post-function is configured. You can identify it under the <actions> tag.

     

  5. Write down the transition name in the table.

  6. Work your way up further on the file from the line you have found the transition, to find the name of the workflow. You can identify it under the <Workflow> tag. Refer to the above image.

  7. Write down the workflow name.

  8. Find the next instance of DelegatingPostFunction

  9. Repeat steps 2 to 6 until you reach the end of the file.

  10. Repeat steps 1 to 7 but searching for RemoteWorkflowPostFunctionProvider instead of DelegatingPostFunction

  11. Now you will have a list of transitions and their corresponding workflow name.

Post-function Name

Transition Name

Workflow Name

Post-function Name

Transition Name

Workflow Name

Set field Value

Create, Done

SFVFUP

Comment issue

Start Progress, Reject

TPI

Step 3 - Identify workflows and transitions using JMWE conditions

Condition Name

Transition Name

Workflow Name

Condition Name

Transition Name

Workflow Name

 

 

 

At the end of this step, you will create a table with the workflow name and the transition names of all the workflows that contain JMWE conditions.

  1. Find the text com.atlassian.jira.workflow.condition.JiraExpressionWorkflowCondition

  2. Below the search under the argument “full.module.key” find the condition name

  3. Write the condition name in the table

  4. Work your way up on the file from the line that contains com.atlassian.jira.workflow.condition.JiraExpressionWorkflowCondition to find the name of the transition on which the condition is configured. You can identify it under the <actions> tag.

  5.  

     

  6. Write down the transition name in the table.

  7. Work your way up further on the file from the line you have found the transition, to find the name of the workflow. You can identify it under the <Workflow> tag. Refer to the above image.

  8. Write down the workflow name.

  9. Find the next instance of com.atlassian.jira.workflow.condition.JiraExpressionWorkflowCondition

  10. Repeat steps 2 to 6 until you reach the end of the file.

Condition Name

Transition Name

Workflow Name

Condition Name

Transition Name

Workflow Name

Linked issues condition

Create, Done

SFVFUP

Current Status Condition

Start Progress, Reject

TPI

Step 4 - Identify workflows and transitions using JMWE validators

Validator Name

Transition Name

Workflow Name

Validator Name

Transition Name

Workflow Name

 

 

 

At the end of this step, you will create a table with the workflow name and the transition names of all the workflows that contain JMWE validators.

  1. Find the text com.atlassian.jira.workflow.validator.JiraExpressionWorkflowValidator

  2. Below the search under the argument “full.module.key” find the validator name

  3. Write the validator name in the table

  4. Work your way up on the file from the line that contains com.atlassian.jira.workflow.validator.JiraExpressionWorkflowValidator to find the name of the transition on which the condition is configured. You can identify it under the <actions> tag.

  5.  

     

  6. Write down the transition name in the table.

  7. Work your way up further on the file from the line you have found the transition, to find the name of the workflow. You can identify it under the <Workflow> tag. Refer to the above image.

  8. Write down the workflow name.

  9. Find the next instance of com.atlassian.jira.workflow.validator.JiraExpressionWorkflowValidator

  10. Repeat steps 2 to 6 until you reach the end of the file.

Validator Name

Transition Name

Workflow Name

Validator Name

Transition Name

Workflow Name

Linked issues validator

Create, Done

SFVFUP

Field Required Validator

Start Progress, Reject

TPI

Step 5 - Manually edit the XML file

  1. class.name changes for validators and conditions native to Jira Cloud.

    Most issues with JMWE Validators and Conditions can be resolved by a simple search and replace. For each entry in the table below replace the text in the first column (Current class.name) with the text in the second column (New class.name) throughout the file using ReplaceAll.

Current class.name

New class.name

Current class.name

New class.name

com.atlassian.jira.workflow.condition.RemoteOnlyCondition

com.innovalog.jmwe.plugins.conditions.NonInteractiveCondition

com.atlassian.jira.workflow.condition.PreviousStatusCondition

com.innovalog.jmwe.plugins.conditions.PreviousStatusCondition

com.atlassian.jira.workflow.condition.SeparationOfDutiesCondition

com.innovalog.jmwe.plugins.conditions.SeparationOfDutiesCondition

com.atlassian.jira.workflow.validator.FieldRequiredValidator

com.innovalog.jmwe.plugins.validators.FieldRequiredValidator

com.atlassian.jira.workflow.validator.FieldChangedValidator

com.innovalog.jmwe.plugins.validators.FieldChangedValidator

com.atlassian.jira.workflow.validator.FieldHasSingleValueValidator

com.innovalog.jmwe.plugins.validators.FieldHasSingleValueValidator

com.atlassian.jira.workflow.validator.ParentStatusValidator

com.innovalog.jmwe.plugins.validators.ParentStatusValidator

com.atlassian.jira.workflow.validator.PreviousStatusValidator

com.innovalog.jmwe.plugins.validators.PreviousStatusValidator

Step 6 - Import the backup into your JIRA Server/Data Center instance

  1. Zip back the XML file.

  2. Log in to Jira as an administrator.

  3. Restore the data from the xml file into your Jira Server/Data Center instance.

Step 7 - Manually edit the workflows

By now, you will have completed the XML fixes for workflow conditions, validators and unavailable workflow post-functions. The remaining fixes must be done by recreating the post-function and deleting the existing ones. 

Before you start

  1. Open the table prepared in Step 2.

  2. On Jira Server/Data Center and Jira Cloud:

    1. Go to the Administration section

    2. Click on the cogwheel

    3. Go to Issues → Workflows

Recreate the post-functions in Jira Server/Data Center

→ For each affected workflow listed in the table open the workflow in an edit mode in the Cloud and the Server/Data Center.

→ For each affected transition listed for the workflow, go to that transition in the editor and then to the Post Functions tab.

  1. Locate the first strange looking post-function in Jira Server/Data Center. You can easily identify JMWE post-functions imported from Cloud because they appear strange, with either Class: com.atlassian.jira.workflow.function.DelegatingPostFunction or Classcom.atlassian.plugin.connect.jira.workflow.RemoteWorkflowPostFunctionProvider similar to this:

  2.  

  3. Locate the same post-function in Jira Cloud by its position in the list and edit it to see its full configuration.

  4. Recreate the post-function:

    1. Click on Add post-function in Jira Server/Data Center.

    2. Recreate the post-function looking at its equivalent configuration in Jira Cloud. While recreating the post-function you might notice some known incompatibilities in JMWE Server/Data Center. 

    3. Move the post-function right before the existing post-function

    4. Delete the existing post-function in Jira Server/Data Center.

Once all the transitions in a workflow are fixed, publish the workflow.