Recovering Database Attachments

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

This utility is for troubleshooting purposes only. It will not leave your production instance in a valid state. It's for extracting attachments from the database for recovery purposes.

症状

Errors are thrown during Attachment Migration.

原因

The attachments in the database or file system are in an invalid state (there are duplicates, for example), or the job is failing due to memory or swap-space issues.

ソリューション

If the built-in Attachment Migration is failing, several tools can help:

ログ

OutOfMemoryException during migration

If you receive an OutOfMemoryException during the migration, download the attached migrationFix.zip class archive, shut down Confluence, and extract it directly into the <confluence-install>/confluence/WEB-INF/ directory. Once Confluence has restarted, try restarting the attachment migration from within the UI.

Attachment Migration JSP

If migrating from the database to the file system, save the attached jsp file to your <confluence-install>/confluence/admin directory and access http://<server_base_url/admin/migrate_attachments_from_db.jsp. This jsp helps identify which attachments may be problematic, and does the migration one by one if necessary.

(warning) If you are using Confluence 3.4, or if you are using an earlier version and receive a compile error referencing 'bucket.container.ContainerManager,' please instead use this updated jsp and remove the jsp encountering errors from the admin directory.

Make sure to perform this migration in a test instance. Once it's done, change the setting manually:

  1. 次のコマンドを実行します。

     SELECT BANDANAVALUE FROM bandana WHERE BANDANAKEY = 'atlassian.confluence.settings';
  2. change the line to

     <attachmentDataStore>file.system.based.attachments.storage</attachmentDataStore>
  3. 次のコマンドを実行します。

     UPDATE bandana SET BANDANAVALUE = 'paste here' WHERE BANDANAKEY = 'atlassian.confluence.settings';

    When stored on the database, the attachmentDataStore will be set to database.based.attachments.storage

その他のトラブルシューティング

If you receive the error:

caused by: net.sf.hibernate.WrongClassException: Object with id: 29491201 was not of the specified subclass: com.atlassian.confluence.core.ContentEntityObject (Discriminator: GLOBALDESCRIPTION)
at net.sf.hibernate.loader.Loader.getInstanceClass(Loader.java:660)

Delete the Global Logo from the ATTACHMENTDATA table:

You'll need to reupload your global logo afterwards, so save it before deleting if necessary.

delete from attachmentdata where attachmentid in (select attachmentid from attachments where pageid in (select contentid from content where contenttype = 'globaldescription'));
delete from attachments where pageid in (select contentid from content where contenttype = 'globaldescription');

The How to resolve missing attachments in Confluence utility may be helpful as well.

最終更新日: 2016 年 2 月 23 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.