Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/codeclou/advanced-codeblocks-cloud-migration-helper

Convert Server/DataCenter Confluence pages in storage format to their forge Cloud App equivalent
https://github.com/codeclou/advanced-codeblocks-cloud-migration-helper

Last synced: about 1 month ago
JSON representation

Convert Server/DataCenter Confluence pages in storage format to their forge Cloud App equivalent

Awesome Lists containing this project

README

        

# Advanced Codeblocks for Confluence

## :rocket: Cloud Migration Helper

This migration helper transforms a Server/DataCenter Confluence page in Storage Format to
Cloud Confluence Storage Format. It will convert the Advanced Codeblocks for Confluence macros to their Cloud forge app equivalent.

- :book: **[Read the complete migration guide here](https://codeclou.io/advanced-codeblocks-for-confluence/cloud/admin-guide/migration/)**

For example a Data Center Confluence page containing the Advanced Codeblocks Single Macro will look like this:

```

some text

true
light-mono
Bash
test

```

The Cloud App equivalent will look like this:

```

some text


com.atlassian.ecosystem
9a81c16f-31e6-4be7-be6e-dfc872fe4155/35d2082a-431b-46b7-90da-75a526882f2f/static/advancedsinglecodeblockmacro

0658e817-aaf6-7e1d-8000-36a917095fd3
ari:cloud:ecosystem::extension/9a81c16f-31e6-4be7-be6e-dfc872fe4155/35d2082a-431b-46b7-90da-75a526882f2f/static/advancedsinglecodeblockmacro
Advanced Codeblocks Single

test
echo "foo"

true

light-mono
Bash


Advanced Codeblocks Single
default
0658e817-aaf6-7d86-8000-4dd60f28b018



```

 

---

 

### Installation

```
git clone https://github.com/codeclou/advanced-codeblocks-cloud-migration-helper.git
cd advanced-codeblocks-cloud-migration-helper
python3 -m pip install -r requirements.txt
```

 

---

 

### Disclaimer

**:bangbang: Please check the output storage file for errors before submitting it into your Confluence page. codeclou GmbH is not responsible for damages to your Confluence installation and/or content. Please test the output on a test instance first. This tool is provided as an example on how to transform your storage format from server to cloud. It might need further adaption to your specific needs.**

 

---

 

### Run transformer

The extension key must be extracted from the cloud page, see the documentation for details.

```
# single macro
python3 index.py -ek 9a81c16f-31e6-4be7-be6e-dfc872fe4155/35d2082a-431b-46b7-90da-75a526882f2f \
-if ./lib/input/ac-single-test1.input.storage \
-of ./lib/output/ac-single-test1.output.storage

# multi macro
python3 index.py -ek 9a81c16f-31e6-4be7-be6e-dfc872fe4155/35d2082a-431b-46b7-90da-75a526882f2f \
-if ./lib/input/ac-multi-test1.input.storage \
-of ./lib/output/ac-multi-test1.output.storage

# multi remote macro
python3 index.py -ek 9a81c16f-31e6-4be7-be6e-dfc872fe4155/35d2082a-431b-46b7-90da-75a526882f2f \
-if ./lib/input/ac-remote-test1.input.storage \
-of ./lib/output/ac-remote-test1.output.storage
```

Will produce an output like this:

```
======================================
ADVANCED CODEBLOCKS MIGRATION HELPER
======================================

extension key part: 9a81c16f-31e6-4be7-be6e-dfc872fe4155/35d2082a-431b-46b7-90da-75a526882f2f

START > reading storage format file from: ./lib/input/ac-single-test1.input.storage

>> advanced-single-codeblock-macro
macro param lang : Bash
macro param enableddl : true
macro param globaltitle : test
macro param theme : light-mono
macro body (shortened) : echo "foo"
macro attr local id : 0658e829-ab6b-7f11-8000-c612fa7cbd38
macro param local id : 0658e829-ab6b-7fa8-8000-1b5180ffb326

DONE > written transformed storage format to: ./lib/output/ac-single-test1.output.storage
```

The local ids will be auto generated using uuid v7. The classic server/DC macro-id is not used in Cloud and will be discarded.

 

---

 

### Run tests

you might need to add pytest to $PATH first, then:

```
pytest
```

---

 

### License

[MIT](./LICENSE) © [codeclou GmbH](https://github.com/codeclou)