[xwiki-users] Mass query/replace after Mediawiki to Xwiki conversion
Hello, After having succesfully migrated from a 300 pages mediawiki to xwiki (which worked like a charm with the FilterStream app), I need to find a way to automate modifications to the migrated xwiki pages. In mediawiki, I could create "highlighted boxes" in which I put code by simply adding a space caracter as the very first caracter of each line. FilterStream application converted this empty space to "}}}" and "{{{" which is totally the right way to convert this from the MW syntax to XWiki syntax, but doesn't fit my needs. Ideally, I'd like to convert every "{{{" tags to "{{code}}" and every "}}}" tags to "{{/code}}" Do you have any idea how to achieve this ? Regards Denis GERMAIN
Hi Denis,
On 24 Jan 2017, at 16:01, Denis GERMAIN <dt.germain@gmail.com> wrote:
Hello,
After having succesfully migrated from a 300 pages mediawiki to xwiki (which worked like a charm with the FilterStream app),
Nice :)
I need to find a way to automate modifications to the migrated xwiki pages.
In mediawiki, I could create "highlighted boxes" in which I put code by simply adding a space caracter as the very first caracter of each line. FilterStream application converted this empty space to "}}}" and "{{{" which is totally the right way to convert this from the MW syntax to XWiki syntax, but doesn't fit my needs.
Ideally, I'd like to convert every "{{{" tags to "{{code}}" and every "}}}" tags to "{{/code}}"
Do you have any idea how to achieve this ?
I’ve created this FAQ entry for you: http://www.xwiki.org/xwiki/bin/view/FAQ/How%20to%20search%20and%20replace%20... I hope it answers your question :) Thanks -Vincent
Regards Denis GERMAIN
Thanks ! I was trying to update directly the database table xwd_content from public.xwikidoc but I haven't had much success yet (not to mention that this is probably not a good idea). Denis GERMAIN 2017-01-26 9:50 GMT+01:00 Vincent Massol <vincent@massol.net>:
Hi Denis,
On 24 Jan 2017, at 16:01, Denis GERMAIN <dt.germain@gmail.com> wrote:
Hello,
After having succesfully migrated from a 300 pages mediawiki to xwiki (which worked like a charm with the FilterStream app),
Nice :)
I need to find a way to automate modifications to the migrated xwiki pages.
In mediawiki, I could create "highlighted boxes" in which I put code by simply adding a space caracter as the very first caracter of each line. FilterStream application converted this empty space to "}}}" and "{{{" which is totally the right way to convert this from the MW syntax to XWiki syntax, but doesn't fit my needs.
Ideally, I'd like to convert every "{{{" tags to "{{code}}" and every "}}}" tags to "{{/code}}"
Do you have any idea how to achieve this ?
I’ve created this FAQ entry for you: http://www.xwiki.org/xwiki/bin/view/FAQ/How%20to%20search%20and%20replace% 20content%20programmatically
I hope it answers your question :)
Thanks -Vincent
Regards Denis GERMAIN
Plus updating the database directly is dangerous since it means out of sync caches and solr search index among other things. On Thu, Jan 26, 2017 at 10:28 AM, Denis GERMAIN <dt.germain@gmail.com> wrote:
Thanks !
I was trying to update directly the database table xwd_content from public.xwikidoc but I haven't had much success yet (not to mention that this is probably not a good idea).
Denis GERMAIN
2017-01-26 9:50 GMT+01:00 Vincent Massol <vincent@massol.net>:
Hi Denis,
On 24 Jan 2017, at 16:01, Denis GERMAIN <dt.germain@gmail.com> wrote:
Hello,
After having succesfully migrated from a 300 pages mediawiki to xwiki (which worked like a charm with the FilterStream app),
Nice :)
I need to find a way to automate modifications to the migrated xwiki pages.
In mediawiki, I could create "highlighted boxes" in which I put code by simply adding a space caracter as the very first caracter of each line. FilterStream application converted this empty space to "}}}" and "{{{" which is totally the right way to convert this from the MW syntax to XWiki syntax, but doesn't fit my needs.
Ideally, I'd like to convert every "{{{" tags to "{{code}}" and every "}}}" tags to "{{/code}}"
Do you have any idea how to achieve this ?
I’ve created this FAQ entry for you: http://www.xwiki.org/xwiki/bin/view/FAQ/How%20to%20search%20and%20replace% 20content%20programmatically
I hope it answers your question :)
Thanks -Vincent
Regards Denis GERMAIN
-- Thomas Mortagne
That's what I had in mind yes, but I didn't know what else to do until now. The first piece of velocity code does work with "word" replacement but doesn't really like replacing "{{{" or "{{code}}" macros (they are interpreted before execution). I managed to do what I want with trial and error (by changing the code a bit and escaping curly brackets) and it works on a single page. I also got a few timeouts while trying to generalize the process on all my pages but it seems OK now. I checked a few pages out of the hundreds I have migrated and they now have {{code}} tags. Thanks for your help 2017-01-26 10:46 GMT+01:00 Thomas Mortagne <thomas.mortagne@xwiki.com>:
Plus updating the database directly is dangerous since it means out of sync caches and solr search index among other things.
On Thu, Jan 26, 2017 at 10:28 AM, Denis GERMAIN <dt.germain@gmail.com> wrote:
Thanks !
I was trying to update directly the database table xwd_content from public.xwikidoc but I haven't had much success yet (not to mention that this is probably not a good idea).
Denis GERMAIN
2017-01-26 9:50 GMT+01:00 Vincent Massol <vincent@massol.net>:
Hi Denis,
On 24 Jan 2017, at 16:01, Denis GERMAIN <dt.germain@gmail.com> wrote:
Hello,
After having succesfully migrated from a 300 pages mediawiki to xwiki (which worked like a charm with the FilterStream app),
Nice :)
I need to find a way to automate modifications to the migrated xwiki pages.
In mediawiki, I could create "highlighted boxes" in which I put code by simply adding a space caracter as the very first caracter of each line. FilterStream application converted this empty space to "}}}" and "{{{" which is totally the right way to convert this from the MW syntax to XWiki syntax, but doesn't fit my needs.
Ideally, I'd like to convert every "{{{" tags to "{{code}}" and every "}}}" tags to "{{/code}}"
Do you have any idea how to achieve this ?
I’ve created this FAQ entry for you: http://www.xwiki.org/xwiki/bin/view/FAQ/How%20to% 20search%20and%20replace% 20content%20programmatically
I hope it answers your question :)
Thanks -Vincent
Regards Denis GERMAIN
-- Thomas Mortagne
participants (3)
-
Denis GERMAIN -
Thomas Mortagne -
Vincent Massol