POC || Migration ( Confluence Server to Confluence Cloud)
Revision
Date | Author | Version | Description |
---|---|---|---|
Jan 18, 2023 | @Sharmendra Vishwakarma / @Gaurav Gurudas Nadkarni (Unlicensed) | 1.0 | Analysis and solution description along with WBS, Risk and assumptions |
|
|
|
|
1. Problem Statement
Customer is using BRIKIT app on confluence server. Recently, they decided to migrate from confluence server to confluence cloud after which they started experiencing layout related issues in the cloud. The pages which were using BRIKIT plugin and its associated themes and components were having issues. In most of the cases the components were no visible at all on the screen.
2. Analysis
The main issue here is that the Brikit plugin is only available for server/DC but not cloud. Hence, when we are try to migrate the pages, the pages are not showing in Confluence.
2.1 To Do
Need to analyze and check what are the possible option along with the solutions to migrate the BRIKIT develop confluence page to confluence cloud
2.2 Pre-requisites
Sl No# | Items | URL | Description | Status |
---|---|---|---|---|
1 | Access to confluence cloud | https://rakutencartera-sandbox-771.atlassian.net/wiki/spaces/CC/overview?homepageId=2687141 | For Gaurav | open |
2 | Access to confluence Server |
| For Gaurav | open |
3 | cloud app that can render HTML | https://marketplace.atlassian.com/apps/252/html-for-confluence?hosting=cloud&tab=overview |
|
|
2.3 Analysis
Things we have tried so far
Things we have tried | Observation(As things stand) | Status |
---|---|---|
Exported the pages(with BRIKIT macros) from confluence server and imported them to cloud in the word format | It did not come up good. Alignment were not proper. Many of the components were missing. | Not satisfactory |
Exported the pages(with BRIKIT macros) from confluence server and imported them to cloud in the pdf format | It did not work | NOT SATISFACTORY |
Trying with apps which are already existing in marketplace to do this | We tried the following apps -: | NOT SATISFACTORY |
Reaching out to Atlassian | Atlassian were not much keen as this was an app related issue | Not much of help |
Reaching out to Vendor(BRIKIT) for help | Yet to reach out to the Vendor but we do not think it will help us as they themselves do not have any app for cloud and may not be interested in sharing their knowledge with us about inner workings of their server app | Not much help expected |
Think about doing this using scripting(Server to cloud) | Scripting will also have issues. Some issues are as follows,
| DIFFICULT to Archieve |
Think about doing this using scripting(Server to Server) using REST API | Using scripts to convert pages which uses BRIKIT layout to pages which do not have BRIKIT layout in them and then using normal server to cloud migration to migrate these new pages which do not use BRIKIT components Using REST API | Worked |
Manual creation of pages | This should be our last resort | Out of contention |
Using Automation(Selenium) | We are in the process of trying out this approach | didn't work |
2.3.1 Approach Using Automation(Selenium)
We are planning to use automation scripts using selenium to migrate the pages and spaces from Rakuten confluence server to cloud. The idea behind this is to use the capability of the selenium script to automate the interaction which user can have with confluence server. Using this approach we can download the data from the confluence server pages(scraping data from the screen or any other method) and store it locally along with the attachments in those pages. The ideal steps for implementation could be as follows,
Selenium will be used to script the automation to go to different pages in different confluence server spaces
Selenium script will then scrap the data from the screen
Selenium script will also download the attachments from the different pages
Selenium script will then store the data scraped from the screen in some data format ex. excel or csv.
We are also planning to use Selenium to create migrated spaces and pages in the confluence server itself. These migrated spaces and pages will have the same data from the actual pages on confluence server but without any BRIKIT components or macros
Team will decide on a generic layout which we can use for these migrated pages
We will push the data that we scraped/downloaded using selenium script from confluence server to migrated spaces/pages on the confluence server itself using selenium scripts
This way we will have spaces/pages in the confluence server which do not user BRIKIT components or macros but contain all the data from the original spaces and pages
We can then do the migration of the confluence(server to cloud) again and then we will have two sets of spaces, one with BRIKIT components and macros and other which are newly migrated without any BRIKIT components or macros
Once the migration to cloud is done, we can delete one set which has all the spaces(and pages under them) which use BRIKIT macros. After this we will be left with spaces and pages which do not use BRIKIT components or macros
For the links which are embedded in the confluence server pages, we may have to reach out to Atlassian to point them to correct resources on the confluence server
We will be using Selenium scripts to upload the attachments to different pages as well
2.3.2 Approach Using Server REST api to convert BRIKIT pages to non-BRIKIT pages on the server itself
Using the REST api create the space and append Migrated in front of the title of the space
Using the REST api create the page under the migrated space where we will move the contents of the original page
Using the REST api pull in the details of the page to be migrated
Read the body from the REST api response and filter out the BRIKIT related classes and replace these with new non-BRIKIT(simple HTML) elements
Push this new content under the newly created page under the new(migrated) space and then move on to the next page or space
# | BRIKIT Macro | HTML/CSS Replacement | Remarks |
---|---|---|---|
1 | list-children |
|
|
2 | content-column |
|
|
3 | content-block |
|
|
4 | content-layer |
|
|
5 | action-button |
|
|
6 | html-wrap |
|
|
7 | content-layout |
|
|
8 | rotate-content |
|
|
9 | lesson-plan |
|
|
10 | catalog-navigator |
|
|
11 | block-link |
|
|
12 | html-link |
|
|
13 | list-attachments |
|
|
14 | rollover-image-link |
|
|
15 | restrict-content |
|
|
16 | target-new |
|
|
17 | page-turner |
|
|
18 | html-clear |
|
|
19 | display-page-title |
|
|
20 | display-space-name |
|
|
21 | display-space-description |
|
|
22 | choose-timezone |
|
|
23 | hello |
|
|
24 | target-current |
|
|
25 | include-content |
|
|
26 | list-spaces |
|
|
27 | list-favorites |
|
|
28 | html-copy-element |
|
|
29 | html-add-class |
|
|
30 | comment |
|
|
31 | blog-tree |
|
|
API Details(Confluence Cloud)
Requirement | API | Body Data | Description | |
---|---|---|---|---|
1 | Adding content to the page(simple text content) | https://host/wiki/rest/api/content/{contentid} | {
"version": {
"number":1
},
"title": "Testing",
"type": "page",
"body": {
"storage": {
"value": "<h1>Problem Statement</h1><p>Customer is using BRIKIT app on confluence server. Recently, they decided to migrate from confluence server to confluence cloud after which they started experiencing layout related issues in the cloud. The pages which were using BRIKIT plugin and its associated themes and components were having issues. In most of the cases the components were no visible at all on the screen.</p><h1>Analysis</h1><p>The main issue here is that the Brikit plugin is only available for server/DC but not cloud. Hence, when we are try to migrate the pages, the pages are not showing in Confluence.</p>",
"representation": "storage"
}
}
}
| Version: The version of the page title: title of the page page will be created like this |
2 | Adding attachment to the content |
|
| Added files will be able to seen in this place. |
API Details (Confluence Server)
# | Requirement | API Detail |
---|---|---|
1 | Get spaces and pages under those spaces |
|
2 | Get content of the page |
|
3 | Update content of the page |
|
2.3.3 Conclusion
We tried both Selenium and API approach to extract the confluence data. Using selenium we are unable to scrape the data fully along with the attachments. Eventually decided to use REST API to extract , convert and save the data in confluence server. Once conversion is done, admin needs to migrate the converted pages to confluence cloud
3.Solution Description
3.1 Pre-requisites
Sl No# | Items | Description |
---|---|---|
1 | Know how many spaces are available in confluence server |
|
2 | Know how many pages are available in confluence server |
|
3 | Create new instance and copy all the spaces and pages in Confluence server |
|
4 | Need access to confluence Server to run the conversion script | Permission to install the software( python ) |
5 | Create Brikit element conversion mapping sheet | Prepare list of mapping between Brikit element and HTML element |
3.2 Solution
Flow Diagram
Approach
Steps | Step Description | Remarks |
---|---|---|
1 | Copy all the spaces and pages from the confluence server [ Without Script] | This step should be done without any script |
2 | Data Extraction [ using Script] |
|
2.1 | Get the list of all Spaces and pages recursively |
|
2.2 | Go to each space, read the page and extract the content |
|
2.3 | Check if the page is using brikit theme |
|
2.3.1.1 | If yes , then relace the brikit elements with HTM by applying the conversion script |
|
2.3.1.2 | Save the content to the current page |
|
2.3.1.3 | If No, don’t apply and script conversion |
|
2.4 | Repeat Step 2.2 , apply conversion and save the content whenever required |
|
3 | Migrate the space and pages to confluence cloud |
|
WBS
Sl No# | Task | Description | Estimated Effort( Hours) |
---|---|---|---|
1 | Development of script |
|
|
1.1 | Setup the dev environment |
| 2 |
1.2 | develop logic to read the list of all the spaces and pages | Logic to read all the pages using REST API | 16 |
1.3 | develop logic to read each page and extract the content using REST API |
| 8 |
1.4 | develop logic to check/verify if the conversion script can be applied |
| 8 |
1.5 | develop logic to apply the conversion script to the page |
| 8 |
1.6 | Develop logic to save the converted page content |
| 8 |
1.7 | Develop log to capture the error with report | Log all the errors and generate conversion report | 16 |
2 | Testing |
|
|
|
| Test the scripts with 5 space | 16 |
|
|
| 82 |
3 | Script execution | Space 40 and approx. 360 pages Assuming 1 page conversion time : 5 mins For 360 pages = 3600 * 5 = 1800 mins = 30 hours | 58 |
4 | Sanity check |
|
|
4.1 | Fix the Based on error and report |
| 16 |
4.2 | Run the script independently to check if any Brikit page left over |
| 8 |
|
|
| 24 |
Total estimated development effort = Development of script + Testing = 82 Hrs
Total Script Execution = Script execution + Sanity check based = 58 Hrs + 24 Hrs = 82 Hrs
Total estimated effort = 164 Hrs
Note: If two resources work on this project, it will take 15 days approx. to complete the conversion
4. Risks & Assumption
Risks
Risk | Priority | Mitigation |
---|---|---|
Access to confluence server | High | Need access to the server before we start the development for all the developers |
Access to rest API | High | Need access to the REST APIs |
Script execution time | Medium | As per our assumption , each page execution may take 5 mins. Any delay from server/APIs/Network may affect the timelines |
Assumptions
Team has access to all the spaces required for the migration
Team has access to server to develop and deploy the script
Script deployed to Empyra’s data center
Business user/power user available for any clarification
Scheduled calls/meetings with power user for any discussions
Weekly status call with business to share the project progress
Post migration, format of the text from confluence server and confluence cloud will be different. We can’t retain the formats.
References
Page links : https://rakutencartera-sandbox-771.atlassian.net/wiki/spaces/ProdMgt/overview , https://rakutencartera-sandbox-771.atlassian.net/wiki/spaces/PM/overview
https://www.brikit.com/display/manual/Uninstalling+and+Removing+Theme+Press
https://rakutencartera.atlassian.net/wiki/spaces/CSTCM/pages/11698177/Brikit+Themes+Assessment