Hi Roman,
Sorry for the long silence.
On Sat, Nov 10, 2012 at 4:25 PM, Roman Muntyanu
<rmuntyan(a)softserveinc.com>wrote;wrote:
I do have annotations that use custom class. Trying to
upgrade to 4.2 with
enforce option I received this
WARN h.R40001XWIKI7540DataMigration - Skipping database [xwiki] because
it uses a custom annotation class. Comments and anotations will remain
separated
One reason for this might be that you`ve skipped step "1) set your
annotations class to AnnotationCode.AnnotationClass".
If you (force) run the migration while your annotation class is set to
something other than "AnnotationCode.AnnotationClass", it will say that you
are using a custom annotation and will refuse to proceed.
Feeling tells me that if I delete annotations that use
custom class,
restarting tomcat with enforced option will pass.
Question is how do I delete those annotations? (My database does not
contain any *annotation* table, and comments table is empty.)
Sure, you can do it manually.
Basically annotations are just XWiki objects stored in XWiki documents. The
don`t use any custom mapping to specific database tables. You can
view/edit/delete them with the object editor on documents that are
outputted by the script I gave you in my previous mail (new/old annotations
thing).
To be registered as annotations (and displayed in the comments tab),
annotation objects need to be of class 'XWiki.XWikiComments' and have the
'selection' property (this is basically the text that was selected when
creating the annotation) set. Also, you need to be sure not to skip step
"5) set your annotations class to XWiki.XWikiComments" when trying to
migrate/update, otherwise your annotations might not be displayed in the
document's content when "show annotations" is enabled.
Hope this helps,
Eduard
-----Original Message-----
From: Roman Muntyanu
Sent: Friday, November 09, 2012 00:25 AM
To: XWiki Users
Subject: RE: [xwiki-users] Annotations-comments merge validation
Eduard,
Even with such a detailed explanation I still have questions :)
(hopefully final ones)
I have ran the script and half of my annotations are in the old group. I
have tried opening corresponding pages but those annotations won't show up.
Annotations from new group were created after the upgrade to 4.1.3.
I will not be able to check if I used custom annotation before upgrade -
because I have no possibility to restore previous version of the system. I
don't remember myself modifying annotation to be something custom (maybe
when annotations were an early extension), yet that was the error I
received upon upgrade.
About custom mapping - I don't know what that is at all.
If we assume that I don't care about the old annotations, will simply
upgrading to 4.1.4 with xwiki.store.migration.force=R40001XWIKI7540 solve
the issue? How do I junk old annotations in such case? (I have tried force
migration flag with 4.1.3 and the result was all annotations moved to "new"
group, but still nothing was displayed on corresponding pages except for
annotations created after initial upgrade to 4.1.3)
Roman
-----Original Message-----
From: users-bounces(a)xwiki.org [mailto:users-bounces@xwiki.org] On Behalf
Of Eduard Moraru
Sent: Thursday, November 08, 2012 13:48 PM
To: XWiki Users
Subject: Re: [xwiki-users] Annotations-comments merge validation
Hi Roman,
The 4.1.3 release had a couple of problems [1], including one that
unintentionally skipped the annotations migration. The 4.1.4 release fixed
this problem [2], amongst others, and it would be what I recommend you to
use instead of 4.1.3.
I`m not sure if your case fits into the problems specific to 4.1.3 (though
it probably does), but to test if you have annotations that respect the new
format, you could run this piece of velocity code:
{{velocity}}
New annotations: $services.query.hql(", BaseObject comment, BaseProperty
selection WHERE comment.name=doc.fullName AND
comment.className='XWiki.XWikiComments' AND selection.id.id=comment.id AND
selection.name='selection'").execute()
Old annotations: $services.query.hql(", BaseObject annotation WHERE
annotation.name=doc.fullName AND
annotation.className='AnnotationCode.AnnotationClass'").execute()
{{/velocity}}
It will list the documents that contain annotations in the new format and
documents that contain annotations in the old format (not migrated).
Basically the new format is XWiki.XWikiComments class instead of the old
AnnotationCode.AnnotationClass, with the addition that the XWikiComments
objects also have the "selection" property set to whatever was selected
when the annotation was made.
If it turns out that you have old annotations, then you need to check 2
things:
1) That you were not using a custom annotations class before the upgrade,
that is a class that is different from AnnotationsCode.AnnotationsClass
2) That you are not using a custom mapping for the comments If you are in
one of the 2 cases above, then you will not be able to migrate to merged
annotations and comments (ad keep using annotations as
before) because the migration does not support the 2 cases. See the Jira
issue [3] on this matter for more details.
If you are not in one of the 2 cases above, then you need to upgrade to
4.1.4 (or above) and to also force the annotations migration to run again.
To force the migration, once you have upgraded normally to 4.1.4, you have
to:
1) set your annotations class to AnnotationCode.AnnotationClass (By going
into Administration > Applications > Annotations > XWiki class defining
annotations structure)
2) edit xwiki.cfg and specify that you want to force the annotations
migration to be executed by adding the following line:
xwiki.store.migration.force=R40001XWIKI7540
2.1) also make sure that the migrations process itself is enabled
(xwiki.store.migration=1) and that it is enabled for all your wikis if you
are in a miltiwiki environment (xwiki.store.migration.databases=all)
3) restart your wiki and watch the logs as the migration should report
that it is being executed
4) check the results by running the velocity script from the first part of
my mail.
5) set your annotations class to XWiki.XWikiComments since this is what
you will be using from now on
5.1) you should also hide the annotations tab, if you did not already do
so, by going to "Administration > Look & Feel > Page Elemetns > Show
document annotations" and selecting "No".
6) edit xwiki.cfg and remove or comment the forced migration line to avoid
problems.
Hope this helps,
Eduard
----------
[1]
http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWikiEnterpris…
[2]
http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWikiEnterpris…
[3]
http://jira.xwiki.org/browse/XWIKI-8036
On Thu, Nov 8, 2012 at 10:45 AM, Roman Muntyanu
<rmuntyan(a)softserveinc.com>wrote;wrote:
Hello,
I'm trying to validate if upgrade where annotations have been merged
with comments was successful (3.5->4.1.3).
select * from xwikicomments;
returns me 0 records, even though I definitely have page where I
have annotations and I as well see them as comments in the bottom of the
page.
How can I check if annotations are where they should be?
Regards,
Roman
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users