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

Fixed problem importing vB4 albums

Discussion in 'Media Gallery Resolved Bugs' started by dougdirac, Feb 22, 2016.

  1. dougdirac

    dougdirac Member

    Actually the albums import but then I get no images.
    XFMG-import.PNG

    The issue might be related to this: https://xenforo.com/community/threads/attachments-import-failed.105522

    The attachments files were sorted in an odd way, but I fixed that by resorting them before doing the general import. How does the XFMG importer know which directory to look for the old vB attachments?

    I'd appreciate any help.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    We look at your VB database to see if you had the option enabled to store attachments as files or whether it used database storage.

    If the setting is configured to use files, then you should be prompted to confirm the path. However...

    I have just looked at the code and a blank VB4 database I have and I suspect there could be a bug here, so I have a couple of questions:
    1. Are your attachments stored on the file system or are they in the database?
    2. Can you run the following query on your VB database and let me know the result:
    Code:
    SELECT value
    FROM setting
    WHERE varname = 'attachpath'
    If you use a database prefix, you will need to add that to the table name above, e.g. if your table prefix is vb_, the above query would read "FROM vb_setting".
     
  3. dougdirac

    dougdirac Member

    The attachments are stored in the file system.

    Running your query it says the files are in "/path/attachments"

    However, my resorted attachments are in "/path/sorted-attachments". The importer never prompted me to ask for the correct path.

    So how to fix? Thanks!
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    As I thought; that's a bug then.

    Simplest solution for now is to rename the attachments folder from /path/sorted-attachments to /path/attachments :)
     
  5. dougdirac

    dougdirac Member

    Hmm... did that but it's still saying "Imported 0 items."
     
  6. dougdirac

    dougdirac Member

    What info is the importer looking for in the archived_import_log?
     
  7. Chris D

    Chris D XenForo Developer Staff Member

    The user IDs of the users who uploaded images and created albums.

    If albums are being imported then this is working correctly.

    What did you mean about the attachments being sorted in "an odd way" and how did you fix that?
     
  8. dougdirac

    dougdirac Member

    It's described in this thread: https://xenforo.com/community/threads/attachments-import-failed.105522/

    Seems the majority of my vB4 attachments are stored folders like /143/ instead of /1/4/3/ where 143 is a user ID. I have a php script that creates those nested subdirectories and moves the attachments there. Then the XF importer was able to find them.
     
  9. Chris D

    Chris D XenForo Developer Staff Member

    What's the result of this query on your VB database?
    Code:
    SELECT value
    FROM setting
    WHERE varname = 'attachfile'
     
  10. dougdirac

    dougdirac Member

    The response is

    /inetpub/TLA/attachments

    As far as I know, no such path exists on my system.
     
  11. Chris D

    Chris D XenForo Developer Staff Member

    That's not even a valid value for that setting as far as I know.

    I believe that setting should either be 0 if files are served from the database, 1 if the files are served from the old style structure from VB3 or 2 if the files are served from the newer structure e.g. 1/4/3.

    With that in mind, I was expecting that query to return 2.

    If VB is no longer in use, it should be safe to change it to the value we expect:

    Code:
    UPDATE setting
    SET value = '2'
    WHERE varname = 'attachfile'
     
  12. dougdirac

    dougdirac Member

    Yeah we're still live on vB4, but I'm using a copy on a dev server to work out these migration kinks, so it's safe to change.

    So I'll restore the database to before this failed import and try again.
     
  13. dougdirac

    dougdirac Member

    Bam! It worked!

    XFMG-import2.PNG

    It actually confirmed the attachment path (with a chance to edit) this time as well. Thanks for your help!
     
    Chris D likes this.
  14. Chris D

    Chris D XenForo Developer Staff Member

    Excellent; incidentally I have added a fix to the next release for an actual bug which may prevent the attachment path being edited. Thanks.
     
  15. dougdirac

    dougdirac Member

    Thanks! Our vB site is a bit of a mess. I'll be glad to move.
     

Share This Page