Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Confluence Migration: How to Bulk Reviewing and marking email domains as trusted ?

Salim Richa January 15, 2023

Hello Community,

I am trying to migrate confluence spaces using Confluence Cloud Migration Assistant, but it's mandatory to review all the domains manually to migrate the spaces successfully.

I have around 2700 domains and it would take a lot of time to review them all. Is there a way to bulk review all the domains to save time and effort? 

Attached Screenshots

Thank you,Domains2.jpegDomains.jpg

 

2 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
2 votes
Answer accepted
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 16, 2023

Hi, I was able to accomplish by running a zsh for loop with Bob Swift's CLI:

for x in (`cat domainlist.txt`)
do
acli jira --action renderRequest --requestType PUT --request '/rest/migration/latest/email/domain-rules' --requestParameters "{\"domainName\":\"$x\",\"rule\":\"TRUSTED\"}" --contentType JSON
done

(I generated domainlist.txt by dumping a list of users and emails and then grepping for any domains that were not my domain, and then using cut to remove everything but the domain name.)

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 16, 2023

(Note that I only use Bob Swift's CLI because trying to do all the authentication handshaking stuff with Python always makes my head hurt, and all I have to do with CLI is use my username and password or Personal Access Token. :-}

Like Kalin U likes this
Salim Richa January 17, 2023

Thank you

Yves Martin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2023

And here is a short way to produce domain list from PostgreSQL database:

echo "select distinct (string_to_array(email_address, '@'))[2] from cwd_user" | psql --tuples-only --no-align -U confluence -h localhost confluence > domainlist.txt

 

 

Like # people like this
Brian Engert May 15, 2023

I like this answer. I tweaked it some to call the api to pull the list of domains and to use my crowd cookie and curl to call the api.


curl --request GET --url https://confluence/rest/migration/latest/email/domains --cookie 'crowd.token_key=asdf;' | jq -c '.availableDomains[].domainName' | while read i; do curl --request PUT --url https://confluence/rest/migration/latest/email/domain-rules --header 'Content-Type: application/json' --header 'Cookie: crowd.token_key=asdf;' --cookie 'crowd.token_key=asdf;' --data "{\"domainName\":$i,\"rule\":\"TRUSTED\"}" ; done

Like Salim Richa likes this
0 votes
Kalin U
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2023

Did the Atlassian support suggest another solution?

Salim Richa January 15, 2023

I didn't contact Atlassian support yet

TAGS
AUG Leaders

Atlassian Community Events