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

Import from Sonnb and Photopost

Discussion in 'Media Gallery Support' started by Dakis, Mar 7, 2015.

  1. Dakis

    Dakis Well-Known Member

    I have done an import from sonnb's gallery to XFMG, and it's gone quite smoothly :)

    I have a few issues I need to take care of, and I could use some help.

    The first one is that in the previous gallery systems I used it was more usual for the members to leave each photo's title empty and put something in the description field. This had now a result of thousands of photos having a title of "imported item" and their actual title sitting in the description field.

    Is there an SQL query I could run for all photos that have this title, to move whatever lies in the description field and replace the title? Or isn't that the way to do it?

    Could it be something as simple as this for example:

    Last edited: Mar 7, 2015
  2. Chris D

    Chris D XenForo Developer Staff Member

    That query actually should work fine.

    The allowed length of each field is the same so
    you shouldn't hit any character limits.
    Dakis likes this.
  3. Dakis

    Dakis Well-Known Member

    Awesome, thanks Chris.

    Are there redirects from the sonnb gallery? and if so, how do i set it up? I couldn't find any instructions.
  4. Chris D

    Chris D XenForo Developer Staff Member

    Did you import sonnb's gallery first and retain the content IDs?

    If so, the URL structure is almost identical (with an additional bit of code that covers the "photos" route, IIRC) so the redirection actually should happen automatically if you retained the same IDs. If you didn't do this, unfortunately you'd either need to do the import again, or look for some other custom coded redirection solution.
  5. Dakis

    Dakis Well-Known Member

    I didn't retain the content ids :(

    All good, doesn't matter much at this point. I'll come back after I do the tricky part, the photopost import :ROFLMAO:
  6. Dakis

    Dakis Well-Known Member

    I have to do the import again afterall, to retain the id's. What is the best way to do it? I've uninstalled the add-on, but the files I suspect remain in the attachments folder, so how do I clean it up? Or perhaps I don't have to, and I just do the import again after re-installing the add-on? will the image files be overwritten?
  7. Chris D

    Chris D XenForo Developer Staff Member

    Bear in mind I did give you the advice some time ago when you asked:
    Uninstalling the add-on will mark the files for deletion and they will be cleaned up within 24 hours. So, don't worry about them unless you're really tight on disk space.
    Dakis likes this.
  8. Dakis

    Dakis Well-Known Member

    Thanks Chris - you did give me that advice, and I actually wanted to retain the IDs but my youngest daughter was sitting on my lap when I was doing the import so I think she distracted me :ROFLMAO:

    Rule n.1 : never-EVER put a toddler between yourself and the keyboard when you surf your admin panel :whistle:
    jeffwidman, Alfa1 and Chris D like this.
  9. Chris D

    Chris D XenForo Developer Staff Member

    Just never.
    Amaury likes this.
  10. Dakis

    Dakis Well-Known Member

    Ok I've let it a few days, and the disk space came back down but not completely, there's 2.5 gb that have been left on top of what I had before converting - is there anything else I can check/remove that might not have been deleted automatically?

    Otherwise i'll just go ahead and reconvert (retaining ID's this time - no toddlers allowed)
  11. Chris D

    Chris D XenForo Developer Staff Member

    It sounds like a lot, but I guess it could be the thumbnails depending on how big your gallery is.

    How big is your data/xengallery directory?

    I imagine that would be at least 1GB.

    The other > 1GB is likely to be a copy of the thumbnails in the XF attachment directory, data/attachments. It's safe to delete that directory. You could then rebuild the attachment thumbnails from Admin CP > Tools > Rebuild Caches > Rebuild attachment thumbnails.
  12. Dakis

    Dakis Well-Known Member

    Thanks for the reply Chris, the data/xengallery folder is 2,2 gb.

    Data/attachments is only 10 megabytes.
  13. Chris D

    Chris D XenForo Developer Staff Member

    Oh, that makes sense actually because the attachments thumbs will have been cleaned up automatically.

    Anyway, yeah it's safe to delete the data/xengallery directory before doing the import again.
    Dakis likes this.
  14. Dakis

    Dakis Well-Known Member

    Awesome, thanks.
  15. Dakis

    Dakis Well-Known Member

    Ok import done again, id's retained, and the url's as you said Chris remained the same except the actual install folder, so that's great :)

    My question is how do the automatic redirects happen? Do I need to just go in my phpmyadmin and change my /gallery/ urls (sonnb) to /media/ urls? or is it some rule I flick in my .htaccess?
  16. Chris D

    Chris D XenForo Developer Staff Member

    To be honest, I would just change the media/ route that XenForo Media Gallery uses to gallery/

    You can do that by going to Admin CP > Route Filters > Click on the existing route filter: xengallery/ > media/ > Edit media/ to gallery/

    Then it should work.

    The only exception to this might be thumbnails that were directly linked to. These are trickier because they directly reference files so can't be handled automatically. You could just keep these files, though. Might be the easiest thing to do as it will only be a couple of GB for the thumbnails. The final thing that may need redirecting or converting is any sort of BB Code used in the old Gallery. I have no idea about this, though. You'll possibly need to leave these as they are or have a solution custom developed.
    Dakis likes this.
  17. Dakis

    Dakis Well-Known Member

    doh! I've been working way too hard it seems, forgot all about the route filters! o_O


    The thumbnails are one issue, and the other one are the full images urls that members have thrown in their posts, such as this : http://www.travelstories.gr/communi...αι-στην-κατηφόρα-φαράγγι-partnachklamm.47595/

    What I've done for this though is I ran an SQL query for the /data/photos/ url part (which is where sonnbs gallery stores photos) and then came up with a list of threads to replace these photos one by one. I came up with a list of only 45 threads, so hopefully this won't be a ridiculously long exercise :)

    (for photopost there are hundreds of threads with photos embedded, but we'll tackle that later)

  18. Chris D

    Chris D XenForo Developer Staff Member

    Another solution for that kind of thing is using an add-on that will save files that have been linked to in this way as attachments. I believe @0ptima did something similar. Ultimately it will cost more disk space, but it also means that you won't have missing images anywhere, or have to handle each one manually.
  19. 0ptima

    0ptima Well-Known Member

    Prior to converting PP links to attachments, I stripped all the surrounding PP BB code.

    Here is an overview of what I did
    Stripping old coding from posts
    Dakis and Chris D like this.
  20. Dakis

    Dakis Well-Known Member

    Thanks guys, not sure if I'll be able to use that stuff but I'll have a look when I come across the photopost part.

    For now I'll just change those links manually in these 45 threads.

Share This Page