Import from Sonnb and Photopost

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:

UPDATE xengallery_media
SET media_title = media_description
WHERE media_title = 'Imported Item'


?
 
Last edited:
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.
 
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:
 
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?
 
Bear in mind I did give you the advice some time ago when you asked:
At Step 2, I would recommend doing XenGallery to XMG first and retain the content IDs when setting up the importer. Those are pretty much automatically redirected if you do that.

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.
 
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:
 
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)
 
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.
 
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.
 
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?
 
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.
 
To be honest, I would just change the media/ route that XenForo Media Gallery uses to gallery/

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

Thanks!

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.

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)

:)
 
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.
 
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.

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
 
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.
 
Top Bottom