Migrating Away from Gallery2 - Getting the Images


Joined: 2009-01-30
Posts: 2
Posted: Fri, 2009-01-30 19:36


I regret to say that I must migrate away from Gallery2. We used a Drupal Gallery2 bridge to tie Drupal 5 and Gallery together (g2sync?). Now, we've decided try and convert the Gallery2 images and data FROM gallery into Drupal. The drupal part is easy, the galleries, and even the image pages are easy from Gallery2 into Drupal are easy to do, but due to some reason, there's absolutely no reference easily found in the database to where the actual image files are stored on my server so that I can loop through with our converter script and move/copy the images to the correct place in Drupal's filesystem.

I know where the images are stored, and can see them there (they use g2data/Albums/username/Album/SubAlbum/Image.jpg type of structure, but I was wondering if there was a simple class, helper, or anything that can return the FULL filesystem path of the image so that I can move it over to drupal and use our custom gallery we're building.

Does anyone have any ideas on how to get the full filesystem path with the g_id from the Entity or even g_Item table? A class, helper, or function would be nice for this. I know it has to be possible because Gallery pulls those images from the g2data directory in some way, but the code is very complex, heavily object oriented, and relies on an incredible amount of included classes / functions.



Joined: 2004-07-26
Posts: 6
Posted: Fri, 2009-01-30 23:08


I once migrated from one Gallery2 installation to another and wrote some scripts which hook up with the Gallery2 API and use the database for more information in some cases.
I just uploaded the files at http://philipp.wagner.name/sw/g2transfer.tar.bz2, maybe you find them useful.



Joined: 2009-01-30
Posts: 2
Posted: Fri, 2009-01-30 23:23


Thank you so much for your support. I've downloaded the script and taking a looking at it now. It looks pretty straight forward and uses the same methods I was considering (fopen the file from the DownloadItem link then save it locally). This will work for me, so thanks so much for saving me the time!

Much Appreciated!