Migrating from G2 and G1

ptl

Joined: 2003-06-19
Posts: 54
Posted: Mon, 2013-04-08 17:47

Old topic here: http://galleryproject.org/node/103597

Hi,

If I don't have my (somewhat crude) hack in g2.php my gallery3 gets a lot of 404 errors.

I know G1 and g2 are a bit old, but some of us started using gallery a long time ago (it feels),
so would it be possible to consider improving the "migrated from G1/G2" support?

My hack could be a starting point for functionality, but probably not for implementation.

-Paavo

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2013-04-08 18:04
 
ptl

Joined: 2003-06-19
Posts: 54
Posted: Mon, 2013-04-08 18:13

suprsidr,

first I had G1, then I updated to G2 (importing old stuff), anf I updated to G3 (importing old stuff), so I don't need to import anything any more,
I just want that the old G1/G2 links (that are very many in gazillions of web pages) would work. If you read the old topic you see how the stock G3
fails to show some old the G1/G2 era pictures, even if has all the info it heeds to show those. The hack was pretty much my very first php program.

I'm sure there are others, G1 was one of the best in it's class, so there must be a lot of others who have gone through G1->G2->G3 cycle like me.

-Paavo

 
ptl

Joined: 2003-06-19
Posts: 54
Posted: Mon, 2013-04-15 08:56

Hi,

as a Gallery user, is there a way I could improve the likelihood and/or schedule of this improvement getting into Gallery developers task list?

-Paavo

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2013-04-15 13:34

The devs are heads down on working on 3.1. So another developer would be needed for adding tasks.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
ptl

Joined: 2003-06-19
Posts: 54
Posted: Wed, 2013-04-17 12:40
floridave wrote:
The devs are heads down on working on 3.1. So another developer would be needed for adding tasks.

In addition to donation, is there something else I could do myself?

-Paavo

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2013-04-19 13:26

Find a new developer that is willing to work on it.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
ptl

Joined: 2003-06-19
Posts: 54
Posted: Sat, 2013-04-20 09:00

Hi,

the example code that I wrote and have been using myself is not enough?
At least as a starting point for an existing developer?

But on the other hand I do understand, it is so natural to look forward
for all those new fancy things, and just forget about the support and
maintenance, legacy is so... legacy and boring (some ppl seem to think).

And maybe all G1/G2 users have disappeared, or re-loaded everything to a
fresh G3, but as long as I'm using Gallery I hope the G3s G1/G2 support
will get better some day. To support that, I'll repeat my donation every
now and then (but not every day, I'm not a rich person).

-Paavo

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2013-04-20 20:19
Quote:
the example code that I wrote and have been using myself is not enough?
At least as a starting point for an existing developer?

don't know. I'm assuming it is this patch:
http://galleryproject.org/node/103597#comment-384543
you would like to go into G3?
There was a recent commit by another community member mikeage
had a pull request committed in the same file:
https://github.com/mikeage/gallery3/commit/d3ca2617f21be55509a30b02babec156f0bac539
Perhaps you and him ( http://galleryproject.org/user/58987 ) can collaborate?

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
ptl

Joined: 2003-06-19
Posts: 54
Posted: Fri, 2013-05-17 14:10

Hi,

mikeage was not able to help.

Unless a muracle happens, I need to give up, and patch every gallery version I install.

Not a big deal for me, but I had higher hopes for gallery community, now everybody else
who has G1 & G2 era pics in their G3 will have 404 errors for their old links.

-Paavo

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Fri, 2013-05-17 14:44

@ptl - I'm sure if there are enough folks having the issue, someone will step forward. Remember this is a community driven effort, and the highest needs are met first. Understand the the base gallery devs are focused on just that, the base. Anything else 'added' to the G3 environment is usually community driven based on need, and based on capability or interest in delivering a resource.

 
ptl

Joined: 2003-06-19
Posts: 54
Posted: Sun, 2013-05-19 04:57

I do understand.

here is the patch I have been using in case someone else needs it or can push to G3 codebase.

$ diff g2.php g2.php.orig
51,85d50
<         $tmp1=explode("/", $path);
<         if($tmp1[0] == "d") {
<           $tmp2=explode("-", $tmp1[1]);
<           if(ctype_digit($tmp2[0])) {
<             $tmp3=DB::select()->from('g2_maps')->where('g2_id', '=', $tmp2[0]);
<             $tmp4=$tmp3->execute(); $tmp5=$tmp4->as_array();
<             if((count($tmp5) == 1) && (isset($tmp5[0]['g2_url']))) {
<               $where[0][2][0]=$tmp5[0]['g2_url'];
<               $where[0][2][1]=str_replace(" ", "+", $tmp5[0]['g2_url']);
<             }
<           }
<         } else {
<           if($path == "main.php") $tmp6=$input->get("g2_path"); else $tmp6=$path;
<           $tmp7=explode("/", $tmp6);
<           if(count($tmp7) == 1) {
<             $tmp9=DB::select()->from('g1_maps')->where('g2col_g1album', '=', $tmp7[0])
<               ->and_where('g2col_g1item', 'is', NULL);
<           } elseif(count($tmp7) == 2) {
<             $tmp8=explode(".", $tmp7[1]);
<             $tmp9=DB::select()->from('g1_maps')->where('g2col_g1album', '=', $tmp7[0])
<             ->and_where('g2col_g1item', '=', $tmp8[0]);
<           }
<           $tmpa=$tmp9->execute(); $tmpb=$tmpa->as_array();
<           if((count($tmpb) == 1) && (isset($tmpb[0]['g2col_itemId']))
<             && (ctype_digit($tmpb[0]['g2col_itemId']))) {
<             $tmpc=DB::select()->from('g2_maps')->where('g2_id', '=', $tmpb[0]['g2col_itemId']);
<             if(count($tmp7) == 1) $tmpc->and_where('resource_type', '=', 'album');
<             elseif(count($tmp7) == 2) $tmpc->and_where('resource_type', '=', 'file');
<             $tmpd=$tmpc->execute(); $tmpe=$tmpd->as_array();
<             if((count($tmpe) == 1) && (isset($tmpe[0]['g2_url']))) {
<               $where[0][2][0]=$tmpe[0]['g2_url'];
<               $where[0][2][1]=str_replace(" ", "+", $tmpe[0]['g2_url']);
<             }
<           }
<         }

-Paavo

 
roncar

Joined: 2011-09-16
Posts: 6
Posted: Tue, 2014-01-14 14:42

Finally after 2+ years I found a solution and am able to use Gallery3 on my forum site. Off and on, I have been looking for a simple solution and finally found something. http://wiki.cementhorizon.com/display/CH/Redirecting+old+Gallery+1+URLs+to+Gallery+3

While his solution seemed to delve much deeper into the operating system than I wanted to go, it was enough to point me in the right direction.

Original gallery 2 .htaccess snippet:

Quote:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /gallery/
RewriteRule ^(.*)$ /g2/map?path=$1 [QSA,L,R=301]
</IfModule>

What I changed it to:

Quote:
# added for g3
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteBase /gallery/
RewriteCond %{QUERY_STRING} !^g2_controller=migrate\.Redirect
RewriteRule ^(.*)$ http://mysite.com/gallery3/index.php/g2/map?path=$1 [QSA,L,R=301]
</IfModule>

Tested on my test site for several days, all seemed well so setup G3 on my main site and implemented. No faults yet. Now to figure just how much I can delete from G2 and still keep the G2_migration module working.