📜 ⬆️ ⬇️

How I combined the Tempo plug-in data for the Jira Server and the Jira Cloud and migrated it back to the Jira Cloud

Hello!

Tempo plugins for Atlassian Jira are installed on a large number of Jira instances in both cloud and servers. I had to combine the data from the cloud and server Jira and set the combined data back to Cloud. In addition to the standard Jira data, I also needed to combine data from the Tempo plug-in. In this article I will explain how I did the merging and migration of Tempo data.

Tempo data that I migrated:



The process of integration and migration:


I picked up two Jira with the following configuration: Jira Software 7.11.2 and Jira Service Desk 3.14.2. Then I removed the backup from the Jira Cloud and installed it on the first instance, then I removed the backup from the Jira Server and installed it on the second instance. After that, I transferred the data from the second instance to the first using the Configuration Manager plugin (although you could use the Project Configurator plugin).

As a result, I found that on the first instance, where the merged data was already located, ready for transfer to Cloud, the following data for the Tempo plug-in is missing:
')

It was necessary to fill this data during the migration.

How I migrated the Tempo plugin data


Accounts


With accounts I was lucky. The Tempo plugin has built-in functionality for exporting and importing accounts.

All I needed to do was to install the accounts from the Jira Cloud and the Jira Server into files before installing the merged data into the Jira Cloud, and then, after uploading the merged data to the Jira Cloud, import these files into Cloud.

There was only one problem, that some keys of the accounts in the Jira Cloud and the Jira Server were the same, so I had to change these keys in one of their files. Otherwise, when importing account data with the same keys, the accounts will either be updated or archived, and none of these options suited me.

Teams


With teams it was more difficult. There is no built-in functionality for the transfer of commands. So we had to use Tempo Rest Api to get data on the teams, and then create these teams in the Jira Cloud.

I used the following Rest calls:


I also wanted to use Tempo Rest Api to set the permissions of the command, but found a bug in this Api.

Setting the correct values ​​in the Account and Team fields for all your needs


Since there was no information on the meaning of the Account and Team fields on the Jira combined instance, I needed to save this information before the migration.

For the Jira Cloud, I used the Jira Rest Api to search for all of your search fields that had filled in the Account or Team fields. Then I saved all these values ​​with the field values ​​to a file.

For the Jira Server, I used the Jira Java API to get the values ​​of the Account and Team fields.
As a result, I got two files with information about accounts and commands for ishju from Jira Cloud and Jira Server.

The problem was that after I migrated the merged data to the Jira Cloud and created accounts and commands, the commands and accounts id didn’t coincide with the old ones, so when I set the correct values ​​for the commands and accounts for ishju, I had to remap the old ones going to new.

To update the Account and Team fields, I used the standard Jira Core Rest Api to update your ishju .

Job Records


There were no problems with the job records that came from the Jira Server search. Everything was transferred without any changes, but there were problems with the records of work from our Jira Cloud.

This is due to the fact that when a record of work in the Jira Cloud is added using the Tempo plug-in, this record is added from the user of the Tempo plug-in, and not from the user who makes this record. Therefore, in order to get the correct user, you must retrieve this user from the database of the Tempo plug-in.

For this reason, I had to get the correct users of the records of working with the Jira Cloud before doing the migration.

This was done as follows:

  1. I found everything in Jira Cloud, where the user of the job record was a user of the Tempo plugin. I did this using a standard Jira Core Rest call .
  2. Then I received all the Jira ID job records from received items in step 1 using this Rest call .
  3. Then I received data from the Tempo plug-in for all the work records obtained in step 2 and saved to a file. I obtained the data using Tempo Rest Api .

Then, after I set up a backup with the merged data, I deleted all the work records that were added from the standard user of the Tempo plugin and added records from the file I received in step 3.

It is also better to put the installation of the Remaining Estimate field when adding a job entry to the optional. In this case, you will not need to get the current value of the Remaining Estimate field for your search each time you add a job record.

Unexpected problems


1. When you install the Tempo Timesheets plugin in the Jira Cloud, a connection is created between the Jira Cloud and the Tempo database, which is needed so that when you receive data from the Tempo plug-in, it is the data for your Jira instance.

The problem is that if you restore the Jira Cloud from the backup, then this connection is no longer visible from the Jira Cloud and therefore you have to reinstall the Tempo plugin, and thus a new connection is formed between the Jira Cloud and Tempo. In this case, the old connection actually exists in the Tempo database.

As a result, when you start working with ishya, the data is pulled through the old and the new connection, and the old connection is primary (i.e. if in the old Tempo database there is a command with the same ID as in the new one, then the name of this command will be pulled from the old DB Tempo). But if you enter the Administration commands and accounts through the user interface of the administrator, then we will see the correct data from the last connection. And if we create a custom Tempo Report, we will also see the correct data. Therefore, the old link needs to be deleted, and can be removed only by contacting Tempo. True support Tempo worked very quickly for which I am grateful to her.

2. After I migrated records of work with the Jira Server, some of the work records had a write-off date one day earlier than necessary. This was due to the user's time zone and the date of write-off. I had to write a program to find all such work records and change the date.

In general, this is all you need to do and know in order to successfully transfer the data to the Tempo plug-in. Hope this information will be helpful.

Source: https://habr.com/ru/post/425613/


All Articles