SOLVED: Problem upgrading from 1.6 to 2.1.2

srinivasb

Joined: 2007-02-10
Posts: 4
Posted: Sat, 2007-02-10 07:41

Hi

I am trying to upgrade my gallery from 1.6 to 2.1.2. Followed the instructions on: http://codex.gallery2.org/Gallery2:migration

I am able to access my old gallery (1.6) as well as new gallery 2 without any problem. I am able to add a new album/photo in both the galleries at this point.

I am now trying to import the albums from old 1.6 gallery to 2.0 and running into the following issue. The warning that shows up at the top of the pages are:

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/cinefashions.com/httpdocs/gallery/modules/migrate/classes/Gallery1DataParser.class on line 165

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/cinefashions.com/httpdocs/gallery/modules/migrate/ChooseObjects.inc on line 288

Looking up on google this may be related to album.dat being empty or corrupt. Well, my albumdb.dat simply shows:

# more albums/albumdb.dat
a:0:{}

Not sure if this is the issue. If it is, how do I go about rebuilding this file? The 1.6 doesn't seem to have any issue with this but may be the import script is choking up on this.

Any pointers would be very much appreciated. Thank you.

Gallery version = 2.1.2 core 1.1.0.2
PHP version = 4.3.2 apache2filter
Webserver = Apache/2.0.46 (Red Hat)
Database = mysql 3.23.58, lock.system=flock
Toolkits = ArchiveUpload, Exif, Ffmpeg, NetPBM, Gd
Acceleration = none, none
Operating system = Linux suhritha.com 2.4.21-4.0.1.ELsmp #1 SMP Thu Oct 23 01:27:36 EDT 2003 i686
Default theme = matrix
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

-Srinivas

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2007-02-10 09:10

the album.dat of your albums container doesn't contain a list of child albums? yep, that sounds bad.

did you run the g1 "find_orphans" and "validate_albums" scripts?

--------------
Enter the Gallery 2 Theme Contest today!

 
srinivasb

Joined: 2007-02-10
Posts: 4
Posted: Sat, 2007-02-10 16:23

Running validate_albums.php, I got:

No Missing Files
There are no missing files in this Gallery.
No Invalid Albums Found
There are no invalid albums present in this Gallery.

Running find_orphans.php from the browser:

Fatal error: Allowed memory size of 18874368 bytes exhausted (tried to allocate 46 bytes) in /home/httpd/vhosts/cinefashions.com/httpdocs/g1/classes/Album.php on line 982

Increased the memory limit in /etc/php.ini to 96M and still getting the same error. I am attaching the output of php_info on my machine. What am I missing here?

-Srinivas

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2007-02-10 16:38

> and still getting the same error.

the exact same error "Allowed memory size of 18874368 bytes exhausted" ? you need to restart apache such that changes to php.ini take effect.
also note that there might be multiple php.ini files on your system.
take a look at phpinfo to see which php.ini to edit:
FAQ: What information is required when I ask for help in the forums?
^^ explains phpinfo.

--------------
Enter the Gallery 2 Theme Contest today!

 
srinivasb

Joined: 2007-02-10
Posts: 4
Posted: Sat, 2007-02-10 17:18

Hi

Thank you for such a quick response. From the phpinfo, I could see that it is /etc/php.ini that is being the one to edit. I did that and also restarted Apache. I could see my change in Memory setting in the output of phpinfo as well. I have now up'ed the limit to 128M to see if that helps, but still getting:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 35 bytes) in /home/httpd/vhosts/cinefashions.com/httpdocs/g1/classes/Album.php on line 982

Trying to check phpinfo output, I noted that the local has 32M and server has 128M. So, I commented out the memory limit in .htaccess and now the find_arphans.php worked like a charm, but then in the second step I got the following:

The Webserver has not enough permission to delete the following files:

* jens

Please check the permission of these files and the folder above. chmod them, or ask your admin to do this.

Checking the find_arphans.php file, line 168 I see:

if ($action == 'images') {
$unwriteableFiles = array("jens"); //deleteOrphanedImages($orphanImages);

I am not sure what is that "array (jens)" means. I changed this to:

$unwriteableFiles = deleteOrphanedImages($orphanImages);

And everything went OK. Now, there are no orphaned files. With this I tried to import the gallery 1.6 into my gallery 2 and still hit the same error as seen before:

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/cinefashions.com/httpdocs/gallery/modules/migrate/classes/Gallery1DataParser.class on line 165

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/cinefashions.com/httpdocs/gallery/modules/migrate/ChooseObjects.inc on line 288

I still see the albumdb.dat being empty as before. This kind of confuses me as I am not certain if this is OK to have it this way or not.

# more albumdb.dat
a:0:{}

Anything else that I am missing here?

-Srinivas

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2007-02-10 17:35

i'm not familiar with g1's data format, but it looks like albumdb.dat just contains a serialized array of folder names.
you can generate the contents of albumdb.dat with:

say you have 3 folders in albums/, "album01", "wedding2003", "France".

php -r "print serialize(array('album01', 'wedding2003', 'France'));"

you can then replace the contents of albumdb.dat with the output of the above PHP command.

if that's too complicated, please post here a list of all folders in your albums/ folder and i can post the data that needs to be entered into your albumdb.dat.

--------------
Enter the Gallery 2 Theme Contest today!

 
srinivasb

Joined: 2007-02-10
Posts: 4
Posted: Sat, 2007-02-10 18:42

Hi

I am able to build the albumdb.dat from the folders I got. With that I am past the original error and now importing the albums into my gallery 2. So, the key to the problem is to rebuild the albumdb.dat with serialize command you showed above.

Thank you very much for all your help.

-Srinivas

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Sun, 2007-02-11 18:46

Fixed the "jens" issue in 1.6-RC1-svn-b28

Jens
--
Last Gallery v1 Developer and v1 translation manager.