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.
Is there something that needs to be set for the Sonnb redirection to take place? Perhaps I am not understanding what exactly should happen automatically.

I did an import, retaining the old IDs, but no redirect is taking place.

Old URL: https://coolscifi.com/gallery/photos/kurt-miller-art-gallery.3836/
New URL: https://coolscifi.com/media/kurt-miller-art-gallery.3836/
 
You'd need to change the "media" route to "gallery".

Or, more accurately, you need to change the existing route filter (Admin CP > Route Filters) to point to gallery instead of media.
 
You'd need to change the "media" route to "gallery".

Or, more accurately, you need to change the existing route filter (Admin CP > Route Filters) to point to gallery instead of media.
Thanks. I was thinking the part above about the route was for something else Dakis was trying to achieve, not for the redirects from Sonnb in general.

I tried changing the route and it worked fine but I'm trying to take a step back and keep some stuff as close to stock as possible so I ended up doing an .htaccess entry which so far seems to be working fine also at least for the direct links. There are some misc. other links structures but I'll handle them later, for now the majority of the links indexed in Google are direct page links.
Code:
# Rewrite old Sonnb XenGallery /gallery links to XenForo Gallery /media (works only if IDs were kept during import)
RewriteRule ^gallery/(.*)$ /media/$1 [R=301,NC,L]
 
That query actually should work fine.

The allowed length of each field is the same so
you shouldn't hit any character limits.
Chris, I backed up my db and tried to run this query as above to correct a similar issue:

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

I get a "xengallery media doesn't exist" response.

Please help provide a current query to move the description in media content to media title (to replace imported item). There's way too many to handle manually via inline editing.

Hopefully, character limits will still NOT be a problem.

Thanks a lot.
 
If you're now running XFMG 2.x then the correct queries would be:
SQL:
UPDATE xf_mg_media_item
SET title = description
WHERE title = 'Imported Item'
 
Top Bottom