Is there a way to get my pics and labels out of Gallery 2.3.2?

158 views
Skip to first unread message

John Inman

unread,
May 15, 2022, 11:50:08 AM5/15/22
to Gallery 3 Users
When I built my site years ago, I added several albums in Gallery on my web site. I was hit will hundreds if not thousands of porn spams in my response fields so I closed down my Gallery albums. I long ago forgot my login and the web site was discontinued. I downloaded the full app and files and have saved on my hard drive. I would love to get the albums and labels out so that I can put on a new web site but have no idea how to do this or if it is even possible. I would love some help from the community. I am not a programmer and this is not something I can fix. I can I load them into a new version of Gallery without the spam? Or can I export the albums to build into WP albums? I do not know what to do. 

Thank you in advance. John

Kazuo Kuroi

unread,
May 15, 2022, 10:04:55 PM5/15/22
to Gallery 3 Users
Hi John,

First you gotta relaunch the gallery by migrating it to old Gallery 3, then apply the updates Brad made.

It's involved, that is, if you want the metadata and stuff. Otherwise, go into the var directory and you can find the images in the tree, it's not hard.

With the latest updates installed you can apparently run up to PHP 8 although I've only tested 7.4. I hope this helps at least a little bit

J.R.

unread,
May 16, 2022, 6:06:23 AM5/16/22
to gallery...@googlegroups.com
John,

You've got to give us more information if we're to be of any help.

1) Do you know which version number of Gallery your old website was built with? That's \important to know. Do you recall how many years ago your Gallery website was last online and accessible?

2) Is it correct that you currently have no way of running your old gallery as a publicly accessible website?

3) If you don't know your old user name or password, the only thing you will be able to do is directly access your hard drive where you have saved the old Gallery website files and locate the actual images you originally uploaded to your website when it was working. In the case of Gallery 3 that will most likely be in the a sub-folder named  /var  -- But if you originally kept a copy of every image you uploaded to your website, then you already have copies your those images.

4) the /var folder only holds the images you upload to your Gallery website. Everything else -- the spam comments, labels, descriptions and other text -- are stored inside the MySQL database your old Gallery website was using. Unless you can write your own python script or complex SQL query to pull out those text fields from the database there is no way to separate out the unwanted "spam" content - or even extract the text content you *do* want out of the database... unless you want to edit the database manually, go through each line in the various database tables and copy-and-paste the text you want out of each data field.

Usually in cases like yours, once you've got the images out of the /var folder it's best to simply start over with a fresh install of the latest Gallery 3 software and re-upload the images to that, re-creating any labels or descriptions for them as you go.

-- J.R.

And, of course, if you do get a new Gallery-based website up and running you know know to *never* enable comments from the public (99% of which will be spam) or allow anyone else but you to sign-in to your Gallery. Those happy go-lucky days of audience participation on a website are long gone, washed away by waves of spam... or else morphed into the various "social media" sites like Twitter, Facebook and all the rest. With all the robo-hacking going on now, no one but yourself should ever have log-in access to your site.

-- J.R.





On 5/15/22 11:50 AM, John Inman wrote:
When I built my site years ago, I added several albums in Gallery on my web site. I was hit will hundreds if not thousands of porn spams in my response fields so I closed down my Gallery albums. I long ago forgot my login and the web site was discontinued. I downloaded the full app and files and have saved on my hard drive. I would love to get the albums and labels out so that I can put on a new web site but have no idea how to do this or if it is even possible. I would love some help from the community. I am not a programmer and this is not something I can fix. I can I load them into a new version of Gallery without the spam? Or can I export the albums to build into WP albums? I do not know what to do. 

Thank you in advance. John
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gallery-3-users/e785c90b-ce26-41a4-8bf6-cea4b960e6f3n%40googlegroups.com.

John Inman

unread,
May 16, 2022, 1:01:23 PM5/16/22
to Gallery 3 Users
Thank you so much. Looks like I have my work cut out for me. 

John Inman

unread,
May 16, 2022, 1:02:07 PM5/16/22
to Gallery 3 Users
Thank you so much.

J.R.

unread,
May 16, 2022, 10:14:37 PM5/16/22
to gallery...@googlegroups.com
John,

I forgot to mention one thing: There is no app which can import your Gallery images and database information  into WordPress any other program.

-- J.R.

John Inman

unread,
May 17, 2022, 12:12:15 PM5/17/22
to Gallery 3 Users
Thank you again J.R. a total rebuild is in order for sure. 

Andrew L

unread,
May 23, 2022, 5:50:08 PM5/23/22
to Gallery 3 Users
I am in a similar position...

I have my Gallery 2 on a CPanel server - files and MySQL database. I can get it to display (mostly) if I temporarily roll back the PHP version, although I have other applications on the server, e.g. WordPress that need the PHP to be more recent version.

I can download all the album folders via FTP and can upload them to, for example, Flickr.

However, I would like to extract the captions from the MySQL database and associate them with the images, but I haven't been able to work out which table the captions are in and how they are linked to the JPG file names  (I am not interested in any ratings or comments there might be - possibly spam anyway).

If I can get the captions out and can see how to link them to the files I am happy to write a Python script to rename the images with their captions, e.g. this_is_my_caption.jpg. Or if I can find a photo host with an API I could upload the jpg and the caption programmatically.

Can anyone tell me where the captions are stored in a Gallery 2 MySQL database, and how they are linked to the file structure?

Thanks.

Kazuo Kuroi

unread,
May 23, 2022, 8:33:30 PM5/23/22
to Gallery 3 Users
Hi Andrew,

Who is your cpanel host? In many cases you may be able to switch your PHP handler using the htaccess. I used to host with A2, and IMH and both allowed this, but it was kinda screwy (both switched to lsapi)

If you need help, I can assist you. It's probably a good idea to upgrade to G3 and G3 Revival anyways if the gallery is still being used.
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

Andrew L

unread,
May 24, 2022, 7:03:32 PM5/24/22
to Gallery 3 Users
Thanks. The Gallery2 install is dormant - I haven't added pictures for many years. I may well play with it and try to upgrade it to Gallery3. I could try to use .htaccess to set the PHP version. Even if I successfully upgrade, I won't add more photos to the gallery.

However, before I attempt that, I would like to extract the captions from the MySQL database and find a way to link them to the JPGs in the album file structure.

Can anyone help me find the image captions text in the MySQL database? 

J.R.

unread,
May 29, 2022, 4:17:05 PM5/29/22
to gallery...@googlegroups.com
Andrew,

You seem to indicate you are are not going to try to upgrade your old Gallery 2 installation to the latest version of Gallery 3. This is an often a maddening and frustrating process, particularly when your server environment is not exactly stable as you seem to indicate. You could easily spend many days trying to do this and not have any success. I think your plan to move your images out of the old G2 installation and put them on someplace like Flickr is the best idea. After you've successfully done that you can decide if you want to try to upgrade the old installation to G3.

The very first thing you should do -- no matter which way you go -- is to download the "album" folder and sub-folders inside the Gallery image storage location (this is  /var   folder in Gallery 3... no idea what it is called in G2 since I never used that version). You need to get those original images safely onto your local computer hard drive (or into the "cloud" if you're so inclined) so that if something goes wrong while working on the database to access the text data that you already have those images in hand as a back up.

Remember, Gallery does not actually store the images inside of the MySQL database -- the database only contains a reference link to the physical location of each image in the image folder. Those images stored in your gallery's image folder and sub-folders will be in there with their original names intact -- it will be easy to identify which is which.  So your idea of moving the images onto someplace like Flickr should be easy to do.

As for the text data... now that is actually stored inside the database. I can only be of limited assistance, since I never used Gallery2 and I am only slightly familiar with the structure of the data tables inside the database used by Gallery3 (which has a different structure from the G2 database). There are 23 individual data tables inside the G3 database which work in concert with different aspects of Gallery. During operation they work interactively with each other, storing textual info/links/descriptions/comments/preference settings, etc. into different fields inside one data table or another. It's a very complex interaction and easily broken when manually accessing a data table directly.

Sorry if what I'm saying here is stuff you already know, but you have never told us what your database manipulation experience and skills are so:

Since you have Cpanel access what you need to do is locate the Cpanel app called  phpMyAdmin  and once it loads, click on the name of your database in the left-hand column. This will open up a large window in the right hand column which will display the individual data tables -- you can click on one any of the data tables open it up. This will show you the individual rows of stored data in the table and the data fields contained in each row.

You can click on the "Edit" option to view and modify this data in detail (usually you have to click on a individual row before you can edit it) BEEP! BEEP! BEEP! -- manually editing *anything* in a data table is incredibly dangerous if you do not know exactly what you're doing --  What I suggest you do is only use the "Edit" function to poke around in the various data tables to identify which bits of text are located where, without actually changing anything (either on purpose or accidentally).

That's the only way you're going to be able to figure out which fields of which tables to extract with your python script for later use. I'm attaching an image to this message which shows the initial phpMyAdmin page of a new, empty Gallery 3 installation:

gallery
        3 data tables jpg image

-- J.R.
Gallery 3 Data Tables 800px.jpg

Andrew L

unread,
May 29, 2022, 5:31:33 PM5/29/22
to Gallery 3 Users
Thanks for this.

I might try to upgrade, because I'm a techie at heart (and IT professional!), but only after I have extracted the photos and captions.

I have downloaded the album folder so have the photos and the album structure. However,  my partner put a lot of work into captioning the photos and is keen that we don't lose that information. There are about 1200 images, so quite a bit of work to rekey the captions, though that might be quicker than programming it.

Using PHPMyAdmin I have located the the captions ("titles") in the g2_item table in the column g_title. There is a g_id column with an integer which presumably points to the image.

Unfortunately Gallery2 renamed the uploaded images to aaa.jpg, aab.jpg, aac.jpg etc. - and worse, reused those names in each subdirectory/album. So I am now trying to find a way of linking that g_id to the right file in the right album. I will presumably have to join some tables :-)

Will report more if I make progress!

On Sunday, 29 May 2022 at 21:17:05 UTC+1 J.R. wrote:
Andrew,

You seem to indicate you are are not going to try to upgrade your old Gallery 2 installation to the latest version of Gallery 3. This is an often a maddening and frustrating process, particularly when your server environment is not exactly stable as you seem to indicate. You could easily spend many days trying to do this and not have any success. I think your plan to move your images out of the old G2 installation and put them on someplace like Flickr is the best idea. After you've successfully done that you can decide if you want to try to upgrade the old installation to G3.

The very first thing you should do -- no matter which way you go -- is to download the "album" folder and sub-folders inside the Gallery image storage location (this is  /var   folder in Gallery 3... no idea what it is called in G2 since I never used that version). You need to get those original images safely onto your local computer hard drive (or into the "cloud" if you're so inclined) so that if something goes wrong while working on the database to access the text data that you already have those images in hand as a back up.

Remember, Gallery does not actually store the images inside of the MySQL database -- the database only contains a reference link to the physical location of each image in the image folder. Those images stored in your gallery's image folder and sub-folders will be in there with their original names intact -- it will be easy to identify which is which.  So your idea of moving the images onto someplace like Flickr should be easy to do.

As for the text data... now that is actually stored inside the database. I can only be of limited assistance, since I never used Gallery2 and I am only slightly familiar with the structure of the data tables inside the database used by Gallery3 (which has a different structure from the G2 database). There are 23 individual data tables inside the G3 database which work in concert with different aspects of Gallery. During operation they work interactively with each other, storing textual info/links/descriptions/comments/preference settings, etc. into different fields inside one data table or another. It's a very complex interaction and easily broken when manually accessing a data table directly.

Sorry if what I'm saying here is stuff you already know, but you have never told us what your database manipulation experience and skills are so:

Since you have Cpanel access what you need to do is locate the Cpanel app called  phpMyAdmin  and once it loads, click on the name of your database in the left-hand column. This will open up a large window in the right hand column which will display the individual data tables -- you can click on one any of the data tables open it up. This will show you the individual rows of stored data in the table and the data fields contained in each row.

You can click on the "Edit" option to view and modify this data in detail (usually you have to click on a individual row before you can edit it) BEEP! BEEP! BEEP! -- manually editing *anything* in a data table is incredibly dangerous if you do not know exactly what you're doing --  What I suggest you do is only use the "Edit" function to poke around in the various data tables to identify which bits of text are located where, without actually changing anything (either on purpose or accidentally).

That's the only way you're going to be able to figure out which fields of which tables to extract with your python script for later use. I'm attaching an image to this message which shows the initial phpMyAdmin page of a new, empty Gallery 3 installation:

gallery
        3 data tables jpg image

-- J.R.

On 5/24/22 7:03 PM, Andrew L wrote:
Thanks. The Gallery2 install is dormant - I haven't added pictures for many years. I may well play with it and try to upgrade it to Gallery3. I could try to use .htaccess to set the PHP version. Even if I successfully upgrade, I won't add more photos to the gallery.

However, before I attempt that, I would like to extract the captions from the MySQL database and find a way to link them to the JPGs in the album file structure.

Can anyone help me find the image captions text in the MySQL database? 

On Tuesday, 24 May 2022 at 01:33:30 UTC+1 Kazuo Kuroi wrote:
Hi Andrew,

Who is your cpanel host? In many cases you may be able to switch your PHP handler using the htaccess. I used to host with A2, and IMH and both allowed this, but it was kinda screwy (both switched to lsapi)

If you need help, I can assist you. It's probably a good idea to upgrade to G3 and G3 Revival anyways if the gallery is still being used.

J.R.

unread,
May 30, 2022, 3:01:36 PM5/30/22
to gallery...@googlegroups.com
Andrew,

Well, we both learned something new: G2 *renames* the images to it's own internal code name (a bad programming approach which changed in G3). But did it change the name in just the database field or did also rename the actual uploaded images the album folder. If so, it is no wonder G2 was abandoned for G3.

Best of luck trying to untangle that kind of mess. A suggestion: Is your Gallery 2 installation running well enough to display the pictures with their captions on your Gallery 2 screen? If so, why not copy each caption from its screen and paste that text into a standalone document? Do that for all the captions (easier than re-keying).You could then use that document as a source to cut-and-paste the captions into, say, Flickr if you want. Or maybe, then do a completely new, empty install of the latest Gallery 3 version, get it up and running properly under PHP 7.4 (Brad advises against going to PHP 8 just yet) and then upload your saved images into your new G3 installation and, again, simply cut-and-paste the captions from the document into the new Gallery 3 pages?

The biggest advantage of doing this is that you continue to maintain total control over all of your images, which is not really the case with Flickr or any other third-party image hosting system once you've uploaded your images into it.

By the way, please do me a big favor and tell me what the album storage folder is called in G2 and where it is located in case someone else needs to know.

-- J.R.
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

Andrew L

unread,
May 30, 2022, 6:50:50 PM5/30/22
to Gallery 3 Users
Gallery2 changed the name of the jpg files in the directory structure! There is an aaa.jpg, aab.jpg etc. file in every album folder :-(

However, I have found on uploading some of the photos to Flickr that the EXIF information is intact, so that is helpful.

I can get the Gallery running by changing the PHP version back to 5.6, but that then breaks other sites on the host, and makes things less secure, so I'm setting it back as soon as I have looked at what I want.

I have noticed there is an option to mount the Gallery as WebDAV. The documentation link to the old Gallery2 software site is obviously broken, but I wonder if that gives me an option to export? I might try that too after I have got the important info out.

The path to the photos is:

/pubic_html/gallery2/g2data/[album-name]/aaa.jpg

Looks like I may end up cut-and-pasting or rekeying the captions - I just did one album and it didn't take too long.

So, that's where I've got to.

J.R.

unread,
Jun 1, 2022, 3:12:22 AM6/1/22
to gallery...@googlegroups.com
Andrew,

Glad to hear that things are looking up for you. It turns out there were far more people still using some version of Gallery 2 than anyone realized. The last version, Gallery 2.3 -- which apparently did *not* rename the uploaded images to its own internal naming scheme like previous versions -- was released in November of 2008 and by 2011 the Gallery Development Team announced it was discontinuing all further upgrades and support for it. So, officially, Galley 2 died 11 years ago. This an eternity in software years... and yet people are still managing to rescue their stuff from its sarcophagus... and Gallery 3 is still alive and kicking.

-- J.R.

IŞIKBİNYILI Ünver

unread,
Jun 1, 2022, 7:13:48 AM6/1/22
to gallery...@googlegroups.com
Thank You so much, J.R., Harold and Andrew for this useful discussion.

re php 7.3 - Yes. Certainly. I will keep up with 7.3 until I face another issue.
J.R.'s the initial questions guided me to that. Thanks again.

On the right-top corner in the both Gallery state version 3.
However, I've made an initial test photo upload followed by, which did not work and faced a prior similar outcome. "Broken empty image icon"
I will retry it during the weekend.

My initial Gallery version: I cannot exactly remember. The information I had shared with you was based on the initial licence file in the File Manager. 
I might have upgraded it in 2013 to v. 2.2

All in all, indeed, the discussion in this group has helped me greatly. 

Many thanks,
Best regards,
Bircan



J.R. <jrl...@thepostalzone.com>, 1 Haz 2022 Çar, 03:12 tarihinde şunu yazdı:


--
IsikBinyili.Org Dernegi - http://www.isikbinyili.org -
The Light Millennium -http://www.lightmillennium.org -
"ISIK BINYILI'nin OZU SIZ'siniz ve biz, 'büyük insanlik " için variz."

Andrew L

unread,
Jun 1, 2022, 3:15:13 PM6/1/22
to Gallery 3 Users
Well to be fair to the original Gallery developers, I started with the first Gallery (Gallery1) and at some point upgraded to Gallery2. Photos were actively uploaded from 2002 to March 2008, and the Gallery probably stopped working at some point when the hosting company upgraded the default PHP version beyond PHP5.6, but I didn't notice for a while, and until I discovered this group I didn't know how to fix it.

Even the photos in the March 2008 album follow the aaa.jpg pattern though.

I'm pretty much resigned to rekeying the captions in whatever platform I go to (Piwigo, Zenfolio, Flickr...) - probably only a few hours work over a few evenings :-)

J.R.

unread,
Jun 1, 2022, 3:52:12 PM6/1/22
to gallery...@googlegroups.com
Andrew,

Ah... that explains the renaming of all your uploaded images... see, Gallery 1 did not use a MySQL database at all -- it used what was called a "flat file" database which was basically single large text file with a single line the name and link location of each uploaded image. This was *ancient* tech... and you wanted to prevent this large text list "database" from getting too large --  or Gallery 1 would slow to a crawl (back in 2000 A.D., most everyone had only  DSL or Dial-Up internet connections, remember?). So rather than store the original file names in the flat-file database, Gallery 1 created an "index" scheme and re-named them to very short code names. This keep the flat file database from getting too bulky to run well.

That's a simplistic description, but the end result was when you upgraded to Gallery 2, it simply took those renamed images and their links out of the flat file "database" and inserted them into G2's MySQL database. And somewhere in the Gallery 2 code there was a routine that persevered
aaa.jpg pattern coding and continued to apply it to your more recent uploads. At least I think that's how it happened...

-- J.R.

Andrew L

unread,
Jun 1, 2022, 4:07:43 PM6/1/22
to Gallery 3 Users
Any idea what that flat file was called?

There seem to be files, and albums from the original install still there  on my server so if I can find that flat file it might be the answer to my problem!

J.R.

unread,
Jun 1, 2022, 5:57:18 PM6/1/22
to gallery...@googlegroups.com
Andrew,

Not a clue... even finding any kind of vague reference to Gallery 1 on the internet is hard to do at this point and there never was much technical discussion on it even from the original development team.  But hey, in poking around I found there is still a flat file image app available at Sourceforge... and the sample pics look a *lot* like standard Gallery 2 layouts, so maybe it's a clone of Gallery 1? You could download and install it and see what's under the hood:

https://sourceforge.net/projects/novagallery/

-- J.R

David Jackie Armstrong

unread,
Jun 2, 2022, 4:11:55 AM6/2/22
to Gallery 3 Users
You can still find most of the original pages showing the development from Gallery 1 onwards using the wayback machine internet archive, for example one of the calendar snapshots shows


The source files from Gallery 1 onwards are also at


David.

David Jackie Armstrong

unread,
Jun 2, 2022, 4:19:17 AM6/2/22
to Gallery 3 Users
This expands to the installation documentation for Gallery 1, from the download at sourceforge.

David.

docs.zip

J.R.

unread,
Jun 2, 2022, 2:38:25 PM6/2/22
to gallery...@googlegroups.com
David,

Huh. Thanks for the memory bump. I discovered the Wayback Machine 20 years ago, but often I simply forget to check it when I'm looking for obscure information on the internet.

-- J.R.
Reply all
Reply to author
Forward
0 new messages