[bd] Attachment Store [Paid] 1.3.4

Store attachment differently and more effectively.

  1. thienbui

    thienbui Member

    Do you think I should live updates all attachments in internal_data through S3 by hand.
    Then run AdminCP > Tools > Rebuild Cache.
    In S3 has a lot of folders where I have updated ?
     
  2. xfrocks

    xfrocks XenForo rocks! Staff Member

    No, the directory structure between internal_data and S3 is not the same. You should move the files from internal_data to data before uploading to S3.
     
  3. thienbui

    thienbui Member

    Yes, All attachments are available in internal_data.
    I get this error when trying to run: AdminCP > Tools > Rebuild Cache.
    Screen Shot 2016-10-25 at 3.11.16 PM.jpg
     
  4. thienbui

    thienbui Member

    Fatal Error: Out of memory (allocated 6029312) (tried to allocate 200264146 bytes)
    #0 [internal function]: XenForo_Application::handleFatalError()
    #1 {main}

    Yes, All attachments are available in internal_data.
    I get this error when trying to run: AdminCP > Tools > Rebuild Cache.
     
  5. johndaroza

    johndaroza New Member

    Hi,

    Can you build attachment with dropbox ?? If you can make it, i think i will buy it
     
  6. xfrocks

    xfrocks XenForo rocks! Staff Member

    My suggestion for your case is:
    1. change to use external data
    2. Run the move tool to move files from /internal_data to /data
    3. Upload the files (from /data) to S3 with Amazon command line tool
    4. Run the storage options tool to update links from /data to S3
    Otherwise it won't works since your files are too big to be handled by PHP script.

    Sorry, Dropbox is currently not supported.
     
  7. rsi

    rsi New Member

    Hi,

    Are you ever going to be able to provide help when someone has an issue when trying to correct the links to their attachments after using this add-on?

    I still have the problem where I changed servers and have a new ftp username, etc. and when I try to rebuild those old attachments and/or thumbnails that were uploaded with my old ftp username and etc. it won't do it. It always says it cannot log on using that old username and etc. when trying to rebuild them.

    Is there a way to run an SQL query or something to where we can somehow update those old stored ftp usernames, ports, and passwords? In my case I have only used the ftp feature in this add-on.
    .
     
  8. xfrocks

    xfrocks XenForo rocks! Staff Member

    The add-on comes with a tool in AdminCP > Tools > Rebuild Cache to update storage options. If you ever move your files manually (to/from S3/FTP etc.) you can use the tool to update the url selectively to moved attachments. Let me know if it doesn't work for you?
     
  9. rsi

    rsi New Member

    Hi,

    I've tried that and it doesn't work. All of my attachments were moved to another folder on my server using the ftp option in the add-on. I've never used it for s3. What happened is when I moved everything to another server (not with the attachment store add-on of course) the new hoisting company gave me a different ftp username and password than what I had before on my old server. So when I try to use those rebuild options in the ACP as you have suggested it get thousands of errors because it says it cannot log in with that old username, etc. that were attached to those attachments using the attachment store add-on when I had that old username, etc. on my old server. It rebuilds everything with the new username, etc. but it just cannot do the old attachments and the hosting company will lock me out as a security risk because of thousands of failed login attempts when it tries to rebuild those old attachments.

    Apparently the attachment store add-on stores your ftp username and maybe the password and the port number when it moves attachments. I know it at least stores the username. I'm assuming it’s in the hash, but I'm not positive.

    It there a way you can give me an SQL query or a script I can run to update all of those old usernames and whatever else the attachments have stored like maybe the password, port number, etc? Either that or add a manual update rebuild feature to the add-on itselt that would do the same thing?

    Thanks…
    .
     
    Last edited: Nov 3, 2016
  10. xfrocks

    xfrocks XenForo rocks! Staff Member

    There are 2 tools, the one you mentioned and tried is the move tool. There is another tool named "Update Attachment Data Storage Options" which you should use to update the saved information and point them to the new server since you moved the files yourself.
     
  11. rsi

    rsi New Member

    You mean this one below right? I've tried that before and it didn't work. Is there some special setting? I think I tried it with 'Store file in remote server via FTP', but I believe I also tried 'Default' and 'External' as well. And with 'Store file in remote server via FTP' I'd use my current ftp username and password and not the old one right? All of my files are also in the same folder as they have always been so would maybe creating a new folder and moving them to it with that rebuild process do it if that is the problem? Whenever I have tried it I get thousands of errors for each of the old attachments saying it could not log in with the username and etc. attached to those old attachments.

    1.png

    Also, do any of the settings below need to be changed as well while doing it? Below is what I basically have.

    2.png
    .
     
  12. xfrocks

    xfrocks XenForo rocks! Staff Member

    Yes, that's the below tool. Basically you need to update your new ftp server on the Options page (2nd screenshot) then use the tool (1st screenshot) and enter your old ftp server info. You don't need to enter all info btw. For example: if you have only used 1 server, entering the old server host is enough because the tool will look for existing attachments that match the information you provided and update them with new configuration (as in Options page).
     
  13. rsi

    rsi New Member

    I'll need to try it again and see what happens, but I'm actually back with my old hosting company and on another server which is the 3rd one now, but I no longer have any traces of that second server with that other hosting company. When I moved to the other hosting company I had this problem so I went back to the old hosting company. But now I’m on a newer server with them using a secure log in. I know what my old username and password was, but not the old server id. I hope that won’t be a problem. If so let me know because I would need to contact them to find out.

    Anyway, I'll try it and see what happens and let you know.
    .
     
  14. xfrocks

    xfrocks XenForo rocks! Staff Member

    So you have 3 sets of ftp credentials now right? The 1st one (with the old hosting company), the 2nd one (with the new one) and the 3rd one (back with the old one). Assuming you have moved all the files yourself, you will have to run the tool 2 times. The first time with the 1st ftp credentials and once again with the 2nd set. For each set, you only need to enter one kind of information (either the host or the username or the password). The tool will look for attachments with matching information and update them.
     
  15. rsi

    rsi New Member

    Ok, it still didn't work...

    I used that update feature like you said with my old host/username/password and etc. with my new one via the Attachment menu ACP and it went through all of my attachments without any errors. The problem is when I then go to run the xenforo 'Rebuild Attachment Thumbnails' tool I get the same error below. I've replaced my old actual host/domain info with myolddomain.com to conceal it here.

    Unable to connect to myolddomain.com:21

    Code:
    Error Info
    
    Thumb rebuild for #864: Unable to connect to myolddomain.com:21 - library/bdAttachmentStore/Model/File.php:315
    
    Stack Trace
    
    #0 /home/me/public_html/library/bdAttachmentStore/Model/File.php(381): bdAttachmentStore_Model_File->_ftp_connect(Array)
    
    #1 /home/me/public_html/library/bdAttachmentStore/Model/File.php(29): bdAttachmentStore_Model_File->_ftp_saveFile(Array, '/home/me/p...', '2014/04/864_bef...', 'NC-303_ANT_INPU...')
    
    #2 /home/me/public_html/library/bdAttachmentStore/XenForo/DataWriter/AttachmentData.php(133): bdAttachmentStore_Model_File->saveFile('ftp', Array, '/home/me/p...', '2014/04/864_bef...', 'NC-303_ANT_INPU...')
    
    #3 /home/me/public_html/library/NFLJ/AMS/XenForo/DataWriter/AttachmentData.php(48): bdAttachmentStore_XenForo_DataWriter_AttachmentData->_writeAttachmentFile('/home/me/p...', Array, true)
    
    #4 /home/me/public_html/library/bdAttachmentStore/XenForo/DataWriter/AttachmentData.php(145): NFLJ_AMS_XenForo_DataWriter_AttachmentData->_writeAttachmentFile('/home/me/p...', Array, true)
    
    #5 /home/me/public_html/library/XenForo/DataWriter/AttachmentData.php(167): bdAttachmentStore_XenForo_DataWriter_AttachmentData->_writeAttachmentFileData('\x89PNG\r\n\x1A\n\x00\x00\x00\rIHD...', Array, true)
    
    #6 /home/me/public_html/library/bdAttachmentStore/XenForo/DataWriter/AttachmentData.php(55): XenForo_DataWriter_AttachmentData->_postSave()
    
    #7 /home/me/public_html/library/XenForo/DataWriter.php(1423): bdAttachmentStore_XenForo_DataWriter_AttachmentData->_postSave()
    
    #8 /home/me/public_html/library/XenForo/Deferred/AttachmentThumb.php(67): XenForo_DataWriter->save()
    
    #9 /home/me/public_html/library/bdAttachmentStore/XenForo/Deferred/AttachmentThumb.php(11): XenForo_Deferred_AttachmentThumb->execute(Array, Array, 7.99999809265, '')
    
    #10 /home/me/public_html/library/XenForo/Model/Deferred.php(295): bdAttachmentStore_XenForo_Deferred_AttachmentThumb->execute(Array, Array, 7.99999809265, '')
    
    #11 /home/me/public_html/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.99999809265, '', false)
    
    #12 /home/me/public_html/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
    
    #13 /home/me/public_html/library/XenForo/ControllerAdmin/Tools.php(159): XenForo_Model_Deferred->run(true, NULL, '', false)
    
    #14 /home/me/public_html/library/XenForo/FrontController.php(351): XenForo_ControllerAdmin_Tools->actionRunDeferred()
    
    #15 /home/me/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    
    #16 /home/me/public_html/admin.php(13): XenForo_FrontController->run()
    
    #17 {main}
    
    
    Request State
    
    Array
    
    (
    
      [url] => http://myolddomain.com/admin.php?tools/run-deferred
    
      [_GET] => Array
    
      (
    
      [tools/run-deferred] =>
    
      )
    
    
      [_POST] => Array
    
      (
    
      [redirect] => http://myolddomain.com/admin.php?tools/rebuild&success=1
    
      [execute] => 1
    
      [_xfToken] => ********
    
      )
    
    )
    
    
     
    Last edited: Nov 3, 2016
  16. rsi

    rsi New Member

    Hi,

    I did try it one more time and it still won't work. I have just under 3000 attachments that still have my old host name attached to them, at least to the thumbnail images.

    Host name is was what I really meant and not my ftp user name. It was my old ftp host name which is/was my domain name. The only difference is now I am using a secure ftp host name which has the server ID, but it's still the same domain name overall.

    The problem is it keeps trying to rebuild the attachment thumbnails using that old host name and the 'Update Attachment Data Storage Option' tool is not updating my old host name still attached to those files.

    Anyway, that's the problem I've had for almost a year now. It's either due to a bug in the Attachment Store add-on or that update tool doesn't work or is just not setup to correct my actual problem.

    Is there anyway you can correct the problem or at least send me something that I can run that will correct it?

    Thanks... I really need to get this problem resolved.
    .
     
  17. rsi

    rsi New Member

    Here is one last bit of information...

    I did a search in my database and using the old hostname I see the total below...

    2338 matches in xf_attachment_data

    I then did a search using my new hostname and get the total below...

    1315 matches in xf_attachment_data

    It looks like those matches are hidden within the file hash, right? The update tool is not updating my old hostname in those 2338 matches to the new hostname and that is the problem.

    Anyway, to clarify more I only have those 2 hostnames associated to the attachments I have uploaded using the attachment store add-on. Those 2338 attachments were uploaded back when I was using my domain name for the actual ftp hostname. A few months ago I started using CloudFare so I had to change that ftp hostname to my server's secure hostname instead to get around the upload problem of using my domain name and that is the new 1315 attachments. That other server I was on is not even an issue because I cleaned up and redid the small handful of attachments that were uploaded when I was using it. So, it is just with the 2 different hostnames, my old one and my new one.

    This morning I even disabled CloudFare (paused it) and tried running the update tool again with my domain hostname working and it still did not work. The database search still yields the 2338 matches in the xf_attachment_data table with the old hostname.

    I would gladly make a donation if you can correct this problem because I'm not the only one having it. That update tool is just not working to correct the problem. Either that or if you can provide me with a script I can run to update the hostname in the 2338 attachments. Just send me a PM if necessary and if a donation is required.

    Thank You
    .
     
    Last edited: Nov 4, 2016
  18. xfrocks

    xfrocks XenForo rocks! Staff Member

    Actually the tool keep the old value for tracking reason so it looks like it successfully updated config for 1315 files but failed for 1023 (2338 minus 1315). It would be useful if you can get a dump of two rows for me: one that matches the old host without the new host and one that matches both old host/new host.
     
  19. rsi

    rsi New Member

    Hi,

    No, the 1315 attachments were uploaded using my current hostname so those attachments are fine. I should have made that more clear I guess, sorry... It is the 2338 attachments that need the hostname updated to my current hostname. The ACP tool didn't need to do anything to the 1315 attachments.

    So then I guess that is the problem if it is keeping the old hostname for tracking, correct? How can I update those 2338 attachments to my current hostname? If you could send me something or update the tool where I can just enter the hostname and other information if necessary then I could just run it. If you still need more information let me know.

    Thanks...
    .
     
    Last edited: Nov 7, 2016
  20. xfrocks

    xfrocks XenForo rocks! Staff Member

    When I said the tool keep old host for tracking, it still update the attachment to use the new host but then store the old host separately. That explains why you will still find those record using the old host even for a successful update. Anyway, a dump of the failed attachment would be useful if possible?
     
Loading...