Versioner sammenlignet

Nøgle

  • Linjen blev tilføjet.
  • Denne linje blev fjernet.
  • Formatering blev ændret.

TO:DOs

  • Test xwiki.cfg - xwiki.store.versioning=0 to prevent page versions for tagging etc
  • Set created date/time on Blogposts (not
  • jeg publised data
  • only publised date) - SQL Seems to be the way
  • Set  created date/time on pages (less important) - SQL Seems to be the way
  • Improve logging from convert.py a bit
  • Limit access to User Index (a personal need)

Install XWiki as a Docker solution

...

Go to the Web-interface and do the installation to end after startup.

Remove Extensions

  • Tour App - Not needed and gives anonymous users info not needed

Install Extensions

This can vary a bit - but for my migration scripts, these may be needed as they do substitute several Confluence Macro's:

  • Blog ApplicationAttachment
  • Attachments Macro
  • Video Macro
  • Diagram MacroApplication
  • PDF Viewer Macro
  • Youtube Macro

Migrate

Tip

If You use Gliffy in Confluence, install Draw.io on Confluence as trial and migrate all Gliffy drawings to Draw.io - As the Gliffy macro etc is not supported at all in XWiki.

...

Tip

You may neeed to: apt install python3.12-venv

Start installing and prepare for migration:

Kodeblok
git clone https://moseiseydk@bitbucket.org/moseiseydk/confluence-migrate.git
python3 -m venv confluence-migrate
cd confluence-migrate
source bin/activate
pip install requests
pip install atlassian-python-api  
pip install python-slugify  

...

Edit the confluence.py file and add all space keys You wish to migrate to XWiki:

Kodeblok
space_keys = ["test","familieblog","anmeldelser","andrebilleder","khvg145","familiebilleder","it","ATLASSIAN"]

...

Advarsel

Limitations:

  • All Blogs will end in the "Blog" in Xwiki
  • A max of 50 attachments are supported from a Confluence page (a problem with the atlassian-python-api)
  • The migration can be re-run at any time, XWiki will just update the Page / Blog, but 1-2 history versions will be added per run, so its not optimal for the final run, but for tests it can be fine.
  • max_count = 2000 is set for "blogpost" as there are no way to tell when we are done (a problem with the atlassian-python-api). Make sure this is higher that the total number of blogposts in Your Confluence
  • The page layout of a Confluence page is converted to a Xwiki "container" macro in the migration, that is not to good, some macros will report: The [video] macro is a standalone macro and it cannot be used inline. (This macro generates standalone content. As a consequence you need to make sure to use a syntax that separates your macro from the content before and after it so that it's on a line by itself. For example in XWiki Syntax 2.0+ this means having 2 newline characters (a.k.a line breaks) separating your macro from the content before and after it.)

Start the migration script:

Kodeblok
python3 confluence.py > log.txt

Post migration

Run SQLs

Kodeblok
sudo apt-get install -y postgresql-client-16
psql

psql -U xwiki -h localhost -d xwiki < pages.sql
psql -U xwiki -h localhost -d xwiki < blogs.sql


Do a visual compare.

Examine log.txt for:

  • Errors
  • Pages with restrictions - these are unrestricted in the XWiki, do set restrictions if needed. Use grep:
  • Kodeblok
    cat log.txt | grep restrictons
    Read restrictons for user: bnp@mos-eisley.dk on Page: Kamerarer (61112322)
    Read restrictons for user: noreply@mos-eisley.dk on Page: Kamerarer (61112322)
    Read restrictons for group: familie on Page: 2 x 40 års fødselsdag (38600797)
    Read restrictons for user: bnp@mos-eisley.dk on Page: Christophers Nonfirmation 28-04-2018 (82182177)
    Read restrictons for user: noreply@mos-eisley.dk on Page: Christophers Nonfirmation 28-04-2018 (82182177)
    Update restrictons for user: bnp@mos-eisley.dk on Page: Christophers Nonfirmation 28-04-2018 (82182177)
    Read restrictons for user: bnp@mos-eisley.dk on Page: Sommerferie 2015 (59408386)
    Read restrictons for user: bnp@mos-eisley.dk on Page: Road Trip Sommerferie 2025 (272629841)
    
    

In things went wrong, roll back to the backup.

Style

You may want to style Xwiki, I do a different Theme and a little CSS:

Kodeblok
#xwikimaincontainer { width: 1400px !important;}

body {
    background: url("https://www.mos-eisley.dk/download/attachments/4161541/blue-square.png");
    background-repeat: repeat;
}


Other

Disable Registration in the Amin UI (If You want to)