How to find attachments without a file in filesystem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JayBee4pl
    Member
    • Oct 2019
    • 65

    How to find attachments without a file in filesystem

    Hello,
    we had an incident with our system and now our Database content is newer the our filesystem.
    No we have attachments where the file in the datadir is missing.
    Is there a way toch get a list of db entries where the file is missing?

    Thanks in advance
    Jens
  • victor
    Active Community Member
    • Aug 2022
    • 793

    #2
    The database stores only information about the Attachment: name, type, size, etc. The attachment itself (its contents) is located directly in the your_instance_name/data/upload folder on your server or on AWS.
    If you don't have a backup of your instance, there will be no way to restore your files.

    Comment


    • JayBee4pl
      JayBee4pl commented
      Editing a comment
      ????
      Thats what i wrote.
      I dont want to restore files. I want to delete orphaned db entries.

    • victor
      victor commented
      Editing a comment
      It is unclear whether these files are marked in the database as deleted (deleted = 1). If so, they will be deleted automatically after some time. If they are (deleted = 0) and the deleted files are still in Administration > Attachments, you can filter them and delete them via the UI. And after some time they will be deleted automatically (from database).

      A similar topic with examples about deleting files, attachments and the parameters that affect this is discussed here:https://forum.espocrm.com/forum/gene...after-removing.
      Last edited by victor; 02-17-2025, 03:48 PM.

    • JayBee4pl
      JayBee4pl commented
      Editing a comment
      They are not marked as deleted. Our DB restore was newer than the filesystemrestore. So we have DB entries without a file.
Working...