Skip to content

Instantly share code, notes, and snippets.

@tobiasmh
tobiasmh / gist:3e5aa4f7a37d9e834647
Last active August 21, 2018 18:31
Migrate a Confluence users activity to another user
-- WARNING
-- WARNING THIS IS PROBABLY INCOMPLETE AND MAY BREAK CONFLUENCE. USE AT YOUR OWN RISK
-- WARNING
-- Migrate a Confluence users activity to another user
SELECT * FROM user_mapping WHERE lower_username='old_username' OR lower_username='new_username';
+----------------------------------+------------------+----------------+
| user_key | username | lower_username |
+----------------------------------+------------------+----------------+
| ff8080814094fe77014094ffd60c0115 | old_username | old_username |
#!/usr/bin/env ruby
# To make it work:
# - change account details to yours ( obviously ;) )
# - install mechanize gem in version 1.0.0 ( gem install mechanize -v '1.0.0' )
# - look for !!HERE!! comments in code in case you'd like to change default behavior
# - for best results run this script few times as hipchat / ruby openssl don't play together that well and
# there might be an exception thrown from time to time. Script should retry then but hey.. Nobody is perfect.
# .. and finally. Remember that other part should run this script as well to make history clean.