• Products
  • Documentation
  • Resources

Clean up your server instance before migration

Migration is the perfect opportunity to clean up your data and move to a cleaner slate in the cloud. The moment you decide to migrate, the primary focus should be on evaluating the value of the data versus the volume of data you will be migrating. The more data you migrate, the longer and more complex your migration is likely to be.

Because of this, we recommend taking the time to clean up your server instance before running your test migration. This can result in a smoother migration, fewer performance issues, and even productivity gains once in cloud. 

A thorough diagnosis of the server instance and way of working could include running scripts and negotiating with other stakeholders to make decisions about how to move forward to the cloud. The time frame for the decision-making of what to migrate and what not varies based on the data complexity.

The best time to do a cleanup is before the migration, but strictly not during the migration.

Clean up your Jira instance

Review your Jira data

  • Check for and remove any unused apps or trial data.

  • Make a list of projects that you want to migrate, and if there are any that you don't need, remove it before migrating. In general, unused projects and issues are a great thing to clean up, since they impact performance as well as impact the time you need to spend managing them.

  • See how much data you have and if there are opportunities to reduce data size or complexity. You can use the System info page to access this data. Data could include:

    • Number of projects

    • Number of custom fields

    • Number of workflows

    • Number of screens, issue types, permission schemes

    • Number of users

    • Number of inactive users

  • MANDATORY STEP: Fix any duplicate email addresses. Learn more about fixing duplicate email addresses

  • MANDATORY STEP: Check for conflicts with group names. Learn more about checking for conflicts with group names

  • Use third-party apps like Optimizer for Jira that can help you assess current usage and clean up your system.

  • To ensure successful migration of the server data, use the Database Integrity Checker (native to Jira Server) and the Integrity Check for Jira app from the Atlassian Marketplace to check the status of your data.

  • Learn more tip and tricks for cleaning up Jira from one of our community leaders.

  • Some customers choose to delete all their data and migrate only configuration and empty project containers. This may be a good option if you're planning to start fresh in the cloud, but would like the same configuration you have on the server.

Minimize your Jira data customizations

  • Standardize custom workflows to reduce data complexity before migration.

  • Review groups and permission schemes to see which are being used, which aren't, and if there are opportunities to standardize or simplify them. 

  • Streamline custom fields, schemes, issue types, statuses, resolutions, boards, filters, and screens. 

    • Here are some Jira clean-up queries

These are sample queries and may require some additional tweaking or testing in your own specific environment. Contact a DBA in your organization for additional assistance. Some of these queries may take a long time to run in large instances with millions of rows. Run these with caution, preferably on your testing environment first.

Custom fields which are not used

1 2 3 4 5 select customfield.id from customfield left join customfieldvalue on customfield.id = customfieldvalue.customfield where customfieldvalue.stringvalue is null and customfieldvalue.numbervalue is null and customfieldvalue.textvalue is null order by customfield.id

Custom fields which have low usage

1 2 3 4 select customfield.id, count (*) from customfield left join customfieldvalue on customfield.id = customfieldvalue.customfield group by customfield.id having count (*) < 5 order by count (*) desc

List custom fields that have not been updated after date (YYYY-MM-DD)

1 2 3 4 5 6 7 select field.id, field.cfname from customfield field where field.cfname not in ( select item.field from changeitem item JOIN changegroup cgroup ON item.groupid=cgroup.id where item.fieldtype='custom' and cgroup.created > 'YYYY-MM-DD' ) and customfieldtypekey not like '%com.pyxis.greenhopper%' and customfieldtypekey not like '%com.atlassian.servicedesk%' and customfieldtypekey not like '%com.atlassian.bonfire%'

User activity related to a custom field

Uses the complete custom field id. Ex: customfield_10301

1 2 3 4 select id, entitytype, entityid, username, to_timestamp(lastviewed/1000) as lastviewed, data from userhistoryitem where entityid='customfield_10001' order by lastviewed desc;

List all select-list type custom fields

1 2 select * from customfield where customfieldtypekey = 'com.atlassian.jira.plugin.system.customfieldtypes:select';

List all custom fields along with the options

1 2 3 4 select cf.id, cf.customfieldtypekey, cf.cfname, cfo.sequence, cfo.customvalue from customfield cf join customfieldoption cfo on cfo.customfield = cf.id where customfieldtypekey = 'com.atlassian.jira.plugin.system.customfieldtypes:select' order by cfo.id, cfo.sequence;

Filters which contain a "Custom Field Name" or custom field id "10001"

1 select * from searchrequest where reqcontent like '%Field Name%' or reqcontent like '%10001%';

Workflows that reference a custom field

1 select * from jiraworkflows wf where wf.descriptor like '%customfield_10281%';

Fields with a global context ⭐

1 2 3 4 5 6 7 8 9 10 11 12 13 14 SELECT distinct(p.pkey), cfname, cf.id, p.pname FROM CUSTOMFIELDVALUE cfv left join JIRAISSUE ji on cfv.ISSUE = ji.id right join CUSTOMFIELD cf on cf.id = cfv.customfield left join project p on p.id = ji.project WHERE cf.id in (''' + globalContextIdsCommaSeparated+ ''') GROUP BY cf.id,cf.cfname,p.pkey, p.pname ORDER BY cf.cfname,p.pname

Non-calculated fields with contexts & no values that do not have Screen/Workflow/Notification schemes

1 2 3 4 5 6 7 8 9 10 11 12 SELECT cf.id id, to_char(min(ji.created), 'YYYY/MM/DD'), to_char(max(ji.updated), 'YYYY/MM/DD'), count(distinct(ji.id)) FROM CUSTOMFIELDVALUE cfv left join JIRAISSUE ji on cfv.ISSUE = ji.id left join CUSTOMFIELD cf on cf.id = cfv.customfield GROUP BY cf.id ORDER BY cf.id

Non-calculated fields with contexts, no values, and do not have Workflow/Notification scheme, but are mapped to some screens

1 2 3 4 5 6 7 8 9 10 11 12 SELECT cf.id id, to_char(min(ji.created), 'YYYY/MM/DD'), to_char(max(ji.updated), 'YYYY/MM/DD'), count(distinct(ji.id)) FROM CUSTOMFIELDVALUE cfv left join JIRAISSUE ji on cfv.ISSUE = ji.id left join CUSTOMFIELD cf on cf.id = cfv.customfield GROUP BY cf.id ORDER BY cf.id

Audit custom field misuse

This is a potential query to assist in extracting how custom fields are being used so that you can identify any fields that are being used for alternative purposes, or are just being misused.

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 select customfield.id, customfield.cfname, customfield.description, customfieldvalue.stringvalue, customfieldvalue.numbervalue, customfieldvalue.textvalue, customfieldvalue.datevalue from customfield left join customfieldvalue on customfield.id = customfieldvalue.customfield where customfieldvalue.stringvalue is not null or customfieldvalue.numbervalue is not null or customfieldvalue.textvalue is not null or customfieldvalue.datevalue is not null group by customfield.id, customfield.cfname, customfield.description;

Warning:

  • Deleting custom fields can also delete associated data.

  • Be careful when updating or removing shared configuration entities, such as Issue types, Workflows, Custom fields and Schemes from your server instance if you’re planning to migrate additional projects that share these entities later down the track.

Use Jira Cloud Migration Assistant

Another tactic is to leave behind data you don’t need in cloud. You can use the Jira Cloud Migration Assistant to execute the following pre-migration techniques:

  • Sort project by “last updated” on the project selection page. This can help you focus on which projects to migrate before others.

  • Migrate archived projects either ahead or after the migration so that you don’t increase risk and migration downtime for the active projects that matter to current users.

  • The Jira Cloud Migration Assistant does not migrate all the configurations from your Jira server instance to the cloud. It performs an analysis of what’s needed for the projects you have selected, and only migrates the necessary for those projects to continue working in the cloud. This means that any unmapped or unused configurations like workflow schemes, permissions schemes, custom fields that are not used by the selected projects are not migrated to the cloud. See what gets migrated with the Jira Cloud Migration Assistant

  • Generate the pre-migration report to review your data. 

Before the migration, ensure you have checked everything on the Jira pre-migration checklist.

Clean up your Confluence instance

Review your Confluence data

  • Check for and remove any unused apps or trial data.

  • Consider removing or leaving behind anything that is not in use for long. This could include specific pages, entire spaces, attachments, macros, or apps. Learn more about how to gather usage statistics from Confluence

  • If you're migrating from Confluence Data Center or a large server instance, you may want to test your migration on some of your larger spaces that have lots of comments or attachments.  

Minimize your Confluence data customizations

  • Find number of pages created by a user between a time frame. 

    Sample query
    Query to return statistical results for Content Creation, per user:

    1 2 3 4 5 6 7 8 9 select content.creator, cwd_user.display_name, count(content.contentid) as total_content_created from content inner join user_mapping on content.creator = user_mapping.user_key inner join cwd_user on user_mapping.username = cwd_user.user_name inner join spaces on content.spaceid = spaces.spaceid where contenttype = 'PAGE' and content.creator is not null and content_status = 'current' and prevver is null and content.creationdate between '2018-07-01' and '2019-01-01' group by content.creator, cwd_user.display_nameorder by total_content_created DESC
  • Find last modified date for each space in a given time to look for unused spaces

    Sample query
    List last modification date for each space in a given time:

  • 1 2 3 4 5 SELECT spaces.spacename, spaces.spacekey FROM content, spaces WHERE content.spaceid = spaces.spaceid GROUP BY spaces.spacename, spaces.spacekey HAVING MAX(content.lastmoddate) < '2006-10-10';

Learn more about finding unused spaces or pages

For more information about cleaning up Confluence, see Clean up your Confluence instance.

Before the migration, ensure you have checked everything on the Confluence pre-migration checklist.

More information and support

We have a number of channels available to help you with your migration.

Last modified on Apr 30, 2021
Cached at 10:21 PM on Jun 11, 2021 |

Additional Help

Ask the Community