1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Will old attachment thumbnails automatically get cleaned up?

Discussion in 'XenForo Questions and Support' started by jeffwidman, Sep 12, 2015.

  1. jeffwidman

    jeffwidman Active Member

    I'm switching VPS providers.

    1) Ran initial rsync with board open
    2) Half an hour later, I closed the board and dumped the db
    3) Import the db on the new box, re-opened the board, and start rebuilding elasticsearch cache. Will I'm in there, I figure I might as well rebuild the other caches just in case, so clicked rebuild attachment thumbnails.
    4) Flip the DNS, re-open the board.
    5) An hour later, realized I forgot to do a final rsync for anything uploaded between my initial rsync and when I closed the board.
    6) Re-run rsync from old server to new server. A bunch of attachment files come across--definitely more than would have been uploaded by my users in this period of time.

    So I'm thinking when I ran the 'rebuild attachment thumbnails' it cleaned out a bunch of old files that I then accidentally rsync'ed across again.

    Will these files get cleaned up somehow? Or are they now orphans in my filesystem since any reference to them would have been deleted in the initial attachment cache rebuild...
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    No, those files won't be removed.

    You will need to manually delete them from the file system.
     
  3. jeffwidman

    jeffwidman Active Member

    How do I identify them in order to delete them?

    The rsync list of files was fairly big and scrolled by so fast that it ran out of the terminal history and I can't retrieve it.
     
  4. 0ptima

    0ptima Well-Known Member

    Were the big chunk of files rsynced to the data folder?
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    There isn't really an easy way.

    You would have to compare the first set of digits of the attachment file name with the data_id in the xf_attachment table and delete any which aren't in the table.

    Other than taking up storage space, it won't have any effect on the site.
     
  6. jeffwidman

    jeffwidman Active Member

    The ones I see still in my terminal view are of the form: forum/data/attachments/3/3020-5493a8988fbd199f6ca6450e0cb9a496.jpg

    Is there a way to delete just the thumbnails, since those can be rebuilt via the ACP? For example, are there different subfolders for the actual attachments vs the thumbnails?
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, internal_data and data.

    You will need to manually identify and delete the files.
     
  8. 0ptima

    0ptima Well-Known Member

    These are the thumbnails. I assume it would be safe to clear out each folder and then rebuild the thumbnails again.
     
    jeffwidman likes this.

Share This Page