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

Your Points Tracker
Challenges
Leaderboard
  • 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
Recognition
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?
Kudos
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

Recovering accidentally deleted user macro

Hi,

I accidentally deleted a user macro - instead of clicking on Edit, I clicked on Delete :(

Is there a way to recover the deleted user macro? I have daily backups of the whole installation of Confluence.

Thank you!

2 answers

1 accepted

2 votes
Answer accepted

Ok, I finally found the solution so here it is.

This requires that you have a backup of the confluence database from before deleting the macro. In my case, the database is in postgreSQL so I will use that as an example.

  1. Obtain the backup file: confluence_backup.sql
  2. On a local postgreSQL server create a new empty database called confluence
  3. Import the backup file to the newly created database as follows:
  4. Right click on the empty confluence database and click Restore...
  5. Select the backup file
  6. Press Restore
  7. Browse in the tree to confluence > Schemas > public > Tables > bandana
  8. Right click on the table bandana and select View Data > View Filtered Rows
  9. Enter the following query: bandanakey = 'atlassian.confluence.user.macros'
  10. Click on the Value cell (visible text should be <map>), select all the text and copy to a text editor.

Now you have multiple options. You could either look for the lost macro in the file, select the whole of it (everything between <entry> and </entry> inclusive the two tags) and copy it to your active confluence database (you can connect to it just like you did for the local one) or you could copy the whole content and replace it (if you did not change anything else, for example).

After that save the database and restart confluence. The macro will now be there again!

I guess I don't understand why it wouldn't gracefully prompt you for confirmation like nearly every other Confluence 'delete' action? 

Davin Studer Community Leader Apr 14, 2021

I have created a free app for user macros that fixes a bunch of missing pieces with user macros. One feature is that is gives you a delete confirmation. Also, if allows you to keep history of user macro edits so that even if you do accidentally delete it you can get it back with the history if you have that feature turned on.

https://marketplace.atlassian.com/apps/1218853/enhanced-user-macro-editor

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

🥓🙅🏻‍♀️ Meet-less May Badge!

Hello Confluence Community!  What if i told you that you could have a healthier life and be 100% meet-less? This month, we're promoting a healthy, balanced work diet with Confluence. We la...

205 views 2 13
Read article

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