Wrong Language of pages after migration from Confluence

Hello,

We have successfully migrated from Confluence to Xwiki.We used the Confluence Migration Pro extension for this.

Our localization settings are as follows:

  • Multilingual: no

  • Default language: German

So the entire UI is in German, including all menus, etc.

Problem:
All migrated content has been assigned the language “English” (visible under “Information”). However, the content itself is exclusively in German; there are no translations or anything similar.

This results in “no results” being displayed when users search for something.

However, if I change a page from English to German for testing purposes, the page can be found.

By the way: The option to change a page’s language (pencil icon) only appears after I’ve changed the “Multilingual” option to “yes” under Localization.

Unfortunately, the language change isn’t recursive, meaning the change would have to be made for all pages! Since there are several hundred pages, manually changing the language from English to German is understandably not an option.

Does anyone have a solution?

Thank you and best regards

Alex

1 Like

Hi Alex! Thank you for reaching out.

Unfortunately, this is the XWiki Community Forum, and your question is related to Confluence Migrator Pro, an extension developed and maintained by the company XWiki SAS. The names are quite similar and confusing the 2 happens quite often, so no worries.

If you need professional support, it’s best to contact XWiki SAS directly. Support is included with the purchase of your license, and they’re the best equipped to guide you through fixing this issue. You can find out more about contacting XWiki SAS on the contact page on their website.

In the meantime, you might find this community-made script useful, as a potential workaround: https://snippets.xwiki.org/xwiki/bin/view/Extension/Bulk-update%20document%20default%20language/

Please make sure to review it carefully and test it in a staging environment fist, before using it on your production instance!! As I said, this is a community-made script, so there’s no guarantee it will fix your issue.

Thanks!

1 Like

Thanks for raising this topic – I also had some cleanups to do :slightly_smiling_face:

Very good hint! :wink: I think there is an issue is in the second query in Bulk-update document default language, isn’t it?

def translatedDocuments = services.query.hql(
  'select doc.fullName from XWikiDocument doc where doc.language = :newDefault'
).bindValue('newDefault', request.newDefault).execute();

This effectively asks:

“Does any document anywhere in the wiki exist in newDefault?”

In a real wiki the answer is almost always yes and I got nearly always:

"A translation of the document already exists in the new default language, the document will thus not be updated by the script"

What the script actually need to check is:

“Does this specific document already have a translation in newDefault?”

That means the query must be scoped to the current document:

def translatedDocuments = services.query.hql('''
  select doc.fullName
  from XWikiDocument doc
  where doc.fullName = :name and doc.language = :lang
''')
.bindValue('name', documentFullName)
.bindValue('lang', request.newDefault)
.execute()

With this change, the script correctly detects whether a translation exists for the page being processed, instead of any translation anywhere in the wiki.

Additionally, I added a target space field, similar to the one used in the Bulk replace content in pages snippet, so that the script can be applied more precisely instead of always running on the whole wiki including XWiki. and others.

1 Like