Gallery2.2->3.x migration woes with dead server

75 views
Skip to first unread message

Matthew Smyth

unread,
Sep 25, 2022, 8:43:26 PM9/25/22
to Gallery 3 Users
Hi all,

I've been running Gallery2 for a long time, and last year my server hardware finally gave up.  I have backups, and the hard drives are fine, but I had let my install get woefully out of date, both in terms of G2 and OS/PHP.  So now I'm trying to chart my future path to recovery, and could use some advice from folks who have been there.

I tried building a new server and installing modern OS/PHP (Ubuntu 20, PHP 8.1.2) and was able to successfully start G3... but when I went to import from the prior G2.2 files, the import module was very unhappy (footnote).  It looks like the G3 import depends on G2 being able to execute, and G2 doesn't play nice with new PHP.  So my first question: is there a way to provide the importer with access to the old DB and let it simply pull from there?
(sub-question: am I right about the old-G2-running requirement?  Or is this some other issue that I am not recognizing due to my lack of G3 experience?)

Presuming direct DB import isn't going to be possible, the next option I see is to build an old system (using an earlier Ubuntu and PHP) and try to get G2.2 working again, then get it to G2.3, then to G3, then to a newer PHP... in other words, many small steps.  Is that the only other path, or is there another way that will work with less effort?

In tangential but related effort, I'd like to generate an overview of my album contents from the database, but I can't find any documentation that describes how to identify active albums or how they're hierarchically understood by the code or how to tell which photos are in each album.  Is there a database architecture schematic somewhere that describes how the tables interrelate?  (oh how I wish they had foreign keys)

Thanks for all advice,

-Matthew

--- Footnote: error ---
Hey wait, you're an admin! We can tell you stuff.

There's an error message below and you can find more details in gallery3/var/logs (look for the file with the most recent date on it). Stuck? Stop by the Gallery 3 Forums and ask for help. You can also look at our list of open tickets to see if the problem you're seeing has been reported. If you post a request, here's some useful information to include:
remove Platform information

    Host name: gallery2022
    Operating system: Linux 5.15.0-47-generic
    Apache: Apache/2.4.52 (Ubuntu)
    PHP: 8.1.2
    MySQL: 8.0.30-0ubuntu0.22.04.1
    Server load: 0.0703125 0.119140625 0.04931640625
    Graphics toolkit: imagemagick

remove Gallery stats

    Version: 3.0+ (branch master, build 434)
    Albums: 0
    Photos: 0

Error [ 0 ]: Non-static method GalleryDataCache::put() cannot be called statically

    DOCROOT/var/modules/g2_import/344c2839f766f76358ccb2f74fc2a04a/embed.php[ 33 ]
    28 * @version $Revision: 17657 $
    29 */
    30
    31/* Define G2_EMBED = 1 to remember to generate correct URLs and return the HTML, etc. */
    32require_once('/var/www/G2/modules/core/classes/GalleryDataCache.class');
    33GalleryDataCache::put('G2_EMBED', 1, true);
    34require(dirname(__FILE__) . '/main.php');
    35require('/var/www/G2/modules/core/classes/GalleryEmbed.class');
    36
    37GalleryEmbed::getEmbedPathByHttpRequest();
    38?>

    MODPATH/g2_import/helpers/g2_import.php[ 166 ] » require()

    MODPATH/g2_import/helpers/g2_import.php[ 55 ] » g2_import_Core::init_embed()

    MODPATH/g2_import/controllers/admin_g2_import.php[ 86 ] » g2_import_Core::is_valid_embed_path()

    MODPATH/gallery/controllers/admin.php[ 62 ] » Admin_g2_import_Controller->save()

    {PHP internal call} » Admin_Controller->__call()

    SYSPATH/core/Kohana.php[ 302 ] » ReflectionMethod->invokeArgs()

    SYSPATH/core/Event.php[ 208 ] » Kohana_Core::instance()

    APPPATH/Bootstrap.php[ 67 ] » Event_Core::run()

    DOCROOT/index.php[ 124 ] » require( arguments )

David Jackie Armstrong

unread,
Sep 26, 2022, 4:12:03 AM9/26/22
to Gallery 3 Users
Matthew,

You need to be running G3 on a version of PHP that is compatible with G2 - the import module then works. Choose the highest PHP version that is compatible with G2, that also works with G3.

G2 PHP version compatibility is described in the codex here: http://codex.galleryproject.org/Gallery2:Installation_Requirements.html#PHP_Version_Compatibility

I've previously migrated a customised G2 gallery to G3 and document the steps needed to customise the functionality and appearance here: https://github.com/dajavous/thejigasaurus.com - this included adding extra fields and redoing some of the database import via phpmyadmin sql commands, for example to avoid the album summary and description text being merged.

Regards,

David Armstrong





J.R.

unread,
Sep 26, 2022, 1:25:07 PM9/26/22
to gallery...@googlegroups.com
Matthew.

Not to be rude, but if you're running your own serve what were you thinking, not upgrading it a long, long time ago -- but I guess that doesn't really matter at this point, so:

Yes, Gallery2 must be accessible and "working" although not actively "running" for the G3 import module to pull stuff out of it and into Gallery3. So getting G2.2 working and then upgrading it to G2.3 and then installing Gallery3 in a separate location so that it can access G2 and do the import may be the best, but painful way to go. But this might be an easier, more reliable approach and does not require getting Gallery2 operational again:

Use your server access to navigate to your Gallery2 folder and find the location where your images are stored (it may be:  gallery/var/albums  or something similar). You probably should download the images to your local computer to have a backup in case something goes wrong. Then install the current version of Gallery3 into a separate location of the server, get it running and then manually upload the old images into your completely new installation of Gallery3. You can try to use the Server Add module in G3 to move your old images directly into G3 from the server, but that can be a little tricky to set up, although there is documentation on how to use it. Otherwise you'll have to download your old images onto your local computer and then fire up G3 and use the standard "Add Photo" interface.

Be sure to use Gallery version 3.15 because anything else will simply not run on PHP higher than version 5.6 and once your get Gallery 3 running and the old images into it, you're going to want to upgrade to at least PHP version 7+ on your server. Only download Gallery v. 3.15 from here:

https://galleryrevival.com/

There are others in this group who have successfully done the G2 migration who might be able to offer additional suggestions. Be sure to search though the email group website for previous posts about this type of migration.

Documentation on the 26 different tables in the database and their complex interaction does not exist as far as I know.
It seems to have been a closely guarded secret of the original development group, which disbanded 10 years ago. We've been trying to find something like that for years -- if *anybody* has that kind of documentation on this burning question could you please, please post it? If not maybe provide a link to it?

-- 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/gallery-3-users/90f747a4-2b08-49c5-9980-4be9dd104b09n%40googlegroups.com.

Michael J. Kupec

unread,
Sep 26, 2022, 1:40:03 PM9/26/22
to gallery...@googlegroups.com

To All,

 

I was in the same boat as Matthew and what I did was build a home G2 environment on a Morrow mini PC running openSUSE Leap 42.3.  I set up repositories on a directory on that box so I could add LAMP to it and the last updates available for Leap 42.3. I believe Apache was something like 2012011 (at least API is that), PHP is 5.5.14 and MySQL is 5.0.11

 

On a Raspberry Pi3B I installed latest Debain with latest LAMP versions then originally installed Gallery 3.0.9 as it was the latest a couple years ago, it’s now been upgraded to 3.1.5. In this environment, I could add, remove and update items on my G2 web site and do the same with the G3 site. When G3 was at 3.0.9 I did try to migrate the G2 data to that site but it wasn’t successful.  When I got part of it working, I did see howthe conversion tool in G3 mangled the album summary and description fields together (what was G3’s programmers smoking,snorting/but not thinking?!!!)

 

I wasn’t aware of Matthew’s process of migrating G2 to G3, I knew by looking at G3’s update PHP script that it needed access to the G2 database but wasn’t aware both gallery versions should be running on the same sever, I had use directory sharing between the two servers for the above try. In the end, I just said phuck-it! and slowly just started rebuilding a new G3 album by importing everything. Still haven’t completed that!

 

I scanned over Matthew’s procedures and I think I’ll give that a try. First I need to verify that everything on my G2 server is up to date with right versions, as Matthew describes, then look to install G3 3.1.5 in another directory and try an import.  I’ll first clone the current G2’s hard drive so I have a working stable base line then go from there.

 

This might re-stoke my interest in working on a new theme I was creating to give similar visual results like I had for my G2 pages. IMHO, the biggest mistake done to G3 was deleting all the cool themes and making creating new ones such a challenge.  To be honest, the creators didn’t make G3 better than G2 but went two steps backward in its design. Word has it they were trying to make it simpler to use, however, removing all the cool features G2 had isn’t making something simpler, but just gave it a plain jane in appearance. L

 

Kudo’s to J.R. and the other gentleman (sorry, can’t recall his name) that have taken over G3 and getting it working in the current world. Now if we can just get access to accessing the old Gallery 3.0.9 page, pull all its content down and do a redirect to the Galley Revival page, folks would then be able to get the right working files for migrating to Gallery3 3.1.5!  The old G3 3.0.9 info could be put up as a historical ref on the revival page with links warning anyone who wishes to use the 3.0.9 code, that’s it’s at their own risk and for reference only and NOT to be used for an actual galley website. Acknowledge should be given to the original creators, however they have abandoned this project and I believe have said so with no further interest to continue it.

 

I don’t mind helping with getting the above done if J.R. and whom else don’t have the time to do this.

 

Good luck with getting your new site up under 3.1.5!  I’m going top start the same here with mine and if successful I’ll port it up to my domain for real time use.

 

Michael Kupec

michae...@verizon.net

--

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.

J.R.

unread,
Sep 27, 2022, 3:09:02 AM9/27/22
to gallery...@googlegroups.com
Michael,

The last member of the old gallery development group -- who goes by the name "bharat" -- was also the last one keeping up the old Gallery Project site and its "Gallery Codex" with all the information, downloads, manuals, modules, themes, etc. I got in contact with him about 4 years ago and offered to take over the old Gallery site. He was not enthusiastic and explained that it was a very much cobbled together operation, running on old obsolete packages. He doubted anyone who took it over could make much sense of it. I left the idea open with him. So far bharat has kept much of the old site accessible and (I guess) is paying for the hosting as part of his own operations.

Although I would love to see all that information moved to a site tied to this group and updated, streamlined, etc. I now realize that I simply don't have the time to do that. So your offer to give it a shot is intriguing. Let me see if I can get hold of bharat again and see what he thinks about letting some of us take it over now.

Apparently he's the only one who can get the obsolete version 3.09 of Galley removed from both Source Forge and the Softaculous server-based auto-install app -- and replaced with version 3.15 -- so that's another reason I need to contact him.

By the way, as I mentioned earlier, time flies if you blink your eyes -- version 3.09 of Gallery3 was released in early 2013... almost  10 years ago now (and the development group disbanded shortly after). It was revised/updated to version 3.11 (and then later version 3.15) by Brad Dutton sometime in 2018 (I think).

-- J.R.

J.R.

unread,
Sep 27, 2022, 3:37:55 AM9/27/22
to gallery...@googlegroups.com
David,

I was excited to hear you had documented the steps you used to migrate G2 to G3 and went to the github link you provided. Unfortunately, I couldn't seem to the right document. A lot of people really don't understand Github or how to use it (myself included). Could you possibly put those steps you documented  into a post to this group? I'm sure it would be very helpful -- people still using G2 keep popping up asking for assistance.

-- J.R.
--

Brad Dutton

unread,
Sep 28, 2022, 11:32:06 AM9/28/22
to Gallery 3 Users
If you have a G2 installation that needs to be updated the easiest upgrade path is probably to:
* get a working G2 install running on PHP 7 using something like one of the following:
* install the latest G3 (3.1.5) on the same server
* do the upgrade
* migrate/copy/reinstall/whatever method G3 over to your new server

J.R.

unread,
Sep 29, 2022, 4:03:06 AM9/29/22
to gallery...@googlegroups.com
Brad,

Huh? G2 will run on PHP 7?

Brad Dutton

unread,
Sep 29, 2022, 11:13:26 AM9/29/22
to Gallery 3 Users
Yes, some people have made various modifications to g2 so that it runs under php 7. This isn't the first time I've posted about this, search "pbobbenb" in the archives. I doubt either of these code bases are maintained much (I see the bobosch repository has since been removed), but it can be a temporary solution.

J.R.

unread,
Sep 29, 2022, 6:11:06 PM9/29/22
to gallery...@googlegroups.com
Brad,

Right. I do remember the discussion, but I was left with the impression that a modified G2 which would run on PHP 7 was not yet a working app. Just for kicks I went to
https://github.com/pbobbenb/gallery2  and downloaded it. Never a G2 user myself, but I'm curious enough to give it a test drive. For those like myself who are not Github savvy, when you get to the page just click on the green "Code" button and a window pops open with a link to Download ZIP file.

-- J.R.

Reply all
Reply to author
Forward
0 new messages