Export from databases

shicks

Joined: 2002-09-27
Posts: 13
Posted: Sun, 2014-05-18 07:50

I'm using 2.0.2. I've gone through the database structure and some of the code trying to figure out how to write a SQL to pull the metadata on the images in an album. So far I've come up with:

SELECT ce.g_id,ce.g_parentId
,ent.g_serialNumber,ent.g_creationTimeStamp
,item.g_title,item.g_description,item.g_canContainChildren
,di.g_mimeType
,fse.g_pathComponent
FROM g2_ChildEntity ce
INNER JOIN g2_Item item ON item.g_id = ce.g_id
INNER JOIN g2_FileSystemEntity fse ON fse.g_id = ce.g_id
INNER JOIN g2_Entity ent ON ent.g_id=g_id
LEFT OUTER JOIN g2_DataItem di ON di.g_id = ce.g_id
WHERE ce.g_parentId=35

But I don't know how to write the ORDER BY so the result comes out in the same order as the items in the album.

I really only need the title, description and pathcomponent. 35 in in this example is the album I'm extracting.

Can anyone help? Thanks!!!

 
shicks

Joined: 2002-09-27
Posts: 13
Posted: Sun, 2014-05-18 08:06

I should add that I've tried ORDER BY the dates, id, etc. I think the album is manually sorted. That sort order must be in the database somehow! Thanks.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2014-05-18 12:10
Quote:
I'm using 2.0.2

Huh? Is this an extremely old installation?

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
shicks

Joined: 2002-09-27
Posts: 13
Posted: Sun, 2014-05-18 15:02

Yes, old install. And I can't get any updates of gallery to work. Luckily I copied off the database and albums before even trying.

I'm able to retrieve the album structure and all I need for each item to export it.

I just can't figure out the sort order of the album as is displays in 2.0.2.

Can you point me to how to determine the sort order? Most albums are on manual sort.

Thanks

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2014-05-19 01:33

So I'd install 2.3.2, import from local filesystem, then run a script similar to http://galleryproject.org/node/94122#comment-359451

-s
________________________________
All New jQuery Minislideshow for G2/G3