Cannot find filesystem when upgrading from v10.0 to v13.6

Hi everyone,
As tilte, the old version xWiki store filesystem in /data/storage. When updating to new version, the filesytems are stored in /data/store. How can I migrate the old folder to the new folder?

Here is the picture of old attachments:

I am not sure if I did something wrong in the process, I am running xwiki in a container.

Thanks in advance.

The migration is done automatically. How exactly did you do the upgrade ?

Hi @tmortagne,

I did as 1 described, stop the xwiki container, and run the newer version of docker image. Database container is kept running.

However, I store the attachments as file systems. This shown there are two folders, where the /storage contains the whole old attachments.

Could it be that when you restarted the new xwiki container you forgot the permanent directory volume mapping and then manually merged the 2 permanent directory you had (the old one and the new one), leading to these 2 directories you mentioned.

@tmortagne is there some logs about the automatic migration that he could check?

not sure if I understand you correctly, but I did map the permanent dir from the docker to the local folder
with -v /opt/docker/xwiki/urs/local/wiki:/usr/local/xwiki.
About the manually merged process, I need to check with our previous administrator.

All the executed migrations are logged and in the specific case of the file migration each file path rename is logged too.

@tientran so maybe you could check your upgrade logs to see what happened?

Here is the log of the container:

    2021-09-03 10:14:03,917 [XWiki initialization] INFO  .HibernateDataMigrationManager - Storage schema updates and data migrations are enabled 

    2021-09-03 10:14:04,233 [XWiki initialization] INFO  .HibernateDataMigrationManager - No data migration to apply for wiki [xwiki] currently in version [130200001] 

    2021-09-03 10:14:04,233 [XWiki initialization] INFO  .HibernateDataMigrationManager - Checking Hibernate mapping and updating schema if needed for wiki [xwiki] 
    2021-08-30 02:24:16,984 [XWiki initialization] WARN  d.AttachmentUnifiedDiffBuilder - Failed to compare the content of attachment [icon.png]. Root cause: XWikiException: Error number 3002 in 3: The attachment [Attachment xwiki:Panels.PanelWizard@icon.png] (file /usr/local/xwiki/data/store/file/xwiki/0/1/42dd85f30db08e0b07a656e2fd6160/attachments/c/c/35d4b8e796c869289176c383aa3da3/f.png) could not be found in the filesystem attachment store. 
    2021-08-30 02:24:17,495 [XWiki initialization] WARN  d.AttachmentUnifiedDiffBuilder - Failed to compare the content of attachment [NECog.png]. Root cause: XWikiException: Error number 3002 in 3: The attachment [Attachment xwiki:XWiki.Notifications.MailTemplate@NECog.png] (file /usr/local/xwiki/data/store/file/xwiki/5/4/8461a18320e9f8764e4858557cd5ed/attachments/0/f/cedd9e25894a2ce767d9268533399b/f.png) could not be found in the filesystem attachment store. 

there is no folder contains the attachment in /store, however, the logs show that it tries to retrieve the attachments.

This is different (it’s for the DB migrations). Are these the logs from when you ran XWiki the first time after the upgrade? They could just be the logs from after stopping and restarting XWiki later on…

1 Like

No it’s not, the file store migration is executed in the same system.

What you printed @tientran seems to be what you have now after one or several restarts, what we would need is what is printed during the upgrade (so the first run with the new version).

Hi, sorry for the late reply.

I did today again the upgrade from 13.6 → 13.7 and it seems like the log is the same as above (no sign of migration error or something related, or maybe is there any keywords I can search for?). The only error is that the system cannot find the files in the storage attachment, which are still in /storage.

Any idea how can I get back the log file from the first time starting the docker container? Given I did today with the newer XWiki version.

What I did:
Stop the container, rm the container. Pull the new xwiki image and run it. Go through the wizard. Read the docker container log.

That’s because there is no change between 13.6 and 13.7 that require the execution of a migration. There is no difference between 13.6 and 13.7 regarding the storage of attachments so if something does not work in 13.7 I really doubt it was in 13.6.

I just found out what happened:

our old wiki administrator upgraded it to v11 two years ago and somehow migration failed at that time, he downgraded back to v10 and it stays so until now.
So is there any prober way I can force the migration to see where the issues are?

The migration system is based on a version stored in the database (table xwikidbversion), each migration has a version and if it’s higher than the current version it’s executed. Ideally you should restart from a 10.0 backup but if you don’t have that I guess one way to force executing again 10.0 → 13.6 migrations would be to stop XWiki, change the version in the table xwikidbversion to the version you are supposed to have in 10.0 (should be 911001 from what I see in the code) and restart.

1 Like

I tried to force the migration, here is the log generated:

migration.log (3.0 MB)

where could be the problem?

P/S: the old xwiki version is v10.11.9, not v10.0

liquibase.xml::R130200001::xwiki was: 8:305cab7777f913f56dc0bb74b76a51e9 but is now: 8:b55f5faeb689a2e80a9a333bd33594c5

First time I see this error, but this is not a very common use case and maybe liquibase (which is executed before the file migration) is not a fan of re-executing the same stuff again. You should try to delete its two log tables (DATABASECHANGELOG and DATABASECHANGELOGLOCK) and restart.

OK, so the database version should be more 1008010 but it seems that’s already what you have in the database according to the log.

Thanks a lot, the migration works now. :grin:

Great news :slight_smile:

1 Like