Migration, not all albums showing

zorglubxx

Joined: 2007-03-17
Posts: 2
Posted: Sat, 2007-03-17 19:41

Hi,

I'm trying to migrate my G1 installation to G2. I've followed the migration guide but the problem is that when I go into the import screen, enter the path to my old installation and press continue, I don't see all the albums and sub-albums. I only see a subset of them. Is the upgrade module supposed to update also nest ed albums?

Thank you

 
scaturan
scaturan's picture

Joined: 2004-09-12
Posts: 1153
Posted: Sat, 2007-03-17 19:56

it's recursive. make sure that the correct set of permissions are in place for ~/path/to/gallery/albums/ so G2 can read it.
--

ザ・ブリリアント・グリーン | 吹石一恵 | my blog

 
zorglubxx

Joined: 2007-03-17
Posts: 2
Posted: Sun, 2007-03-18 13:23

I found the problem. I'm on Windows where file and directory names are case insensitive. There were many directory names that had one particular casing on the file system while a different one in the albumsdb.dat. So when PHP tried to build the hierarchy tree, it wasn't working because PHP array indices are case sensitive. The solution was to edit modules/migrate/classes/Gallery1DataParser.class and :

- change line 113 from:

$albumList[$albumName] = $albumFields;

to:

$albumList[strtolower($albumName)] = $albumFields;

- add the following lines right after:

$albumList[strtolower($albumName)]['name'] = strtolower($albumList[strtolower($albumName)]['name']);
$albumList[strtolower($albumName)]['parentAlbumName'] = strtolower($albumList[strtolower($albumName)]['parentAlbumName']);

- change line 142 from:

$parentAlbumList[$albumName] = $albumFields['parentAlbumName'];

to:

$parentAlbumList[strtolower($albumName)] = strtolower($albumFields['parentAlbumName']);

I realize that this will not work on unix and actually break things. But I think it's a worth while fix for Windows. Maybe it could be added to the migrate module with proper platform ifdefs. In any case, if someone else is having the same problem I was they can just modify their copy.