Gallery2 Empty Album Cleanup Help - thousands of them

30 views
Skip to first unread message

ChrisJ

unread,
Jun 20, 2025, 2:12:58 PMJun 20
to Gallery 3 Users

I understand that this is a Gallery3 group, but hoping to find some help.

I have a very old Gallery2 install that’s integrated into a Vbulletin forum. It’s worked really well over the years and we’ve successfully kept it all going through server moves and forced PHP upgrades. I know eventually we’ll need to retire it but hoping to keep it going for a little while longer.

Very soon we're moving to XenForo and have frozen uploaded to the Gallery2 and will disconnect any forum integration.

Before the move we're cleaning up our old forum user base and want to automate/simplify the removal of stagnant matching Gallery Accounts and "User Albums" that are linked.

The way the integration works is that for every forum user that’s was created, a user was mirrored in Gallery2 and a User Album created. We have thousands of empty user albums that need removing.

I’ve tried to figure out some SQL to do the job, but the Schema structure is hard to understand - and I'm thinking simply removing the "album" Items isn't enough.

In an ideal word I’d want to run either an SQL command or a PHP script that uses the API, to find empty User Albums for a given list of user names - then remove the user and album.

Any suggestions?

Thanks in advance

Adrian London

unread,
Jun 21, 2025, 11:34:43 AMJun 21
to Gallery 3 Users
I'm relatively good with SQL but have never used G2, so can't help you with any script.

However, as you say you have scripts which automatically create users and user albums, surely just looking at those will show you what needs to be done to - basically - perform the opposite?

See if this helps:

-- 
Adrian



ChrisJ

unread,
Jul 2, 2025, 1:44:15 PMJul 2
to Gallery 3 Users
Thanks so much. That link really helped and I was able to cobble together a PHP script to clean up the user albums.

Adrian London

unread,
Jul 3, 2025, 8:38:03 AMJul 3
to Gallery 3 Users
Thanks for the update.  

Looking at the PHP in that thread, it seems G2 is built very differently from G3!  Well done for still getting G2 to work.

-- 
Adrian

Reply all
Reply to author
Forward
0 new messages