legacy-knowledge-base
公開されました Sep. 10, 2025

DLFileEntryテーブルにないファイルをドキュメントライブラリから削除するには?

written-by

Rafael Regner

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • DLFileEntryテーブルにエントリがないDocument Libraryファイルをファイルシステムから削除したい。

環境

  • Liferay DXP 7.3

解決

  • 添付のGroovyスクリプトを実行してください: RemoveOrphanedFileEntries.groovy

追加情報

  • スクリプトコンソールからのスクリプトの実行
  • まずは本番環境以外でスクリプトをテストしてください。
  • このスクリプトは、ドキュメントライブラリのパスがデフォルト値 ($[LIFERAY-HOME]/data/document_library) である場合にのみ動作します。 この値が異なる場合は、スクリプトを修正する必要があります。
  • 複数のcompanyがある場合は、スクリプトを調整する必要があります。
  • スクリプトの一番下に、 _safeModeという変数があります。trueの場合、スクリプトは孤立したファイルのみをカウントし、falseの場合、スクリプトは孤立したファイルを削除します。
did-this-article-resolve-your-issue

legacy-knowledge-base