Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Deleting projects is slow


I wrote a Groovy script that delete all projects, except the ones who are in an exclusion list (to build a sandbox).

Tried it on my local Jira installation, works fine. But on our staging server, which have more than 1500 projects, it's slow as hell. Deleting projects with projectService.deleteProject takes a minute per project!

Tried to find why, and saw this:

Which have a similar script, but the author mentions that he delete the indices before deleting the projects. Tried that, sadly it's still very slow (20 deleted projects in 10 minutes). 

I guess deleting projects directly in the bd, while Jira is down of course, will be faster, but I'm pretty sure it will create havoc.

Anyone have seen this problem.

1 comment

Unfortunately, that link gives you bad advice.  Deleting the index will make the process slower, because when the issue is deleted, Jira still does the re-index on the issue, and then has to spend even longer writing out errors about missing the index.  And then you have to re-index the entire system after deletion.  Oh, and you're damaging your data - some parts of the delete use the index to cross-check other things that need to be deleted.

Deleting an issue is quite a complex thing to do.  Issue data is smeared across many many tables in the database, and there's a lot to check and remove.  I strongly recommend NEVER doing a delete via SQL, it will take you weeks to work out what the absolutely correct SQL is, while Jira is offline, and still leave you with a nagging doubt that you've missed something (and you'll also have to do a full re-index afterwards).  As you say - "havoc".

Using projectService.deleteProject is the safest way to delete the projects.  It is not quick, and although I suspect it could be done better, it still wouldn't be fast.  It is safe though.

True. I did a test with deleting the index before deleting the projects, and also without deleting the index, and the difference is minimal. 

For the record, it took about 16 hours to delete 1085 projects.


Log in or Sign up to comment

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you