Hi all... I wondering what state the import utility from Gallery 1.x to 2 is in at the moment, and whether there is any testable code available?
I have a large Gallery 1 collection and would like to see how it is going to behave in the Gallery 2 infrastructure. I am happy to rebuild my Gallery 2 installation from scratch each time... but it would be nice to be able to import from my live Gallery 1 installation.
I am currently having problems with my Gallery 1 installation eating up memory to run and the database backing of Gallery 2 is the thing I am most interested in seeing.
Cheers
Kim
Posts: 974
Hey, Kim, glad to hear that you're interested! I am currently hard at work on the importation utility, and I could certainly use more people testing it. However, at the moment it only imports users and a skeleton structure of albums.
Posts: 4
Thanks for the response.
Is your work in progress code anywhere I can get it from? I would be happy to test what you have so far, and might find some time to help with the code too.
Cheers
Kim
Posts: 974
Woo hoo! I have successfully imported albums and images into my development G2 installation. However...
Importing non-images hasn't been tested
International text hasn't been properly tested
A lot of metadata is being left behind
Most errors are NOT being trapped and handled. This includes trying to import an album into a place where an album of the same name already exists. It just dumps you into a cold hard error page.
Album ownership and permissions are not being imported AT ALL
Bugs abound!
That still leaves room for people to play with the migration module and make requests so I know what functionality other people want.
What can you do to help?
Run the unit tests. Tell me if anything comes up red.
Make a copy of your gallery's (version1) albums. Try to import the copy. Don't freak out if there are errors (there will be), but let me know what you run into. This isn't critical right now since I have plenty fix already, but it is nice to know that people are interested, and alert users are very appreciated.
Posts: 45
[G2 20 November 2003 CVS]
Just wanted to reply to tell you I have tried your Migration Module.
Very nice to see this is being developed, as I (and many others I bet) needs our G1 data converted over to G2.
Well, cut to the chase:
I tried to run your migration and got this:
I guess there are some duplicates problem in my old G1 db? Is there any tool for cleaning up this in G1 before letting Migrate work on the data?
This error happens quite some times, even if I skip the problematic galleries, so either my G1 data is very messed up, or there might be some problems with the script.
I also got some timeout issue, but I haven't been able to reproduce that.
Also:
International characters didn't work, as you suggested. I tried some norwegian letters, and I only get theese nice ? diamonds. but it migrates correctly.
In the migrate module screen it says: " Note: album migration is not yet implemented!"
Is it cause it is not yet finished, or doesnt it have the capability to migrate complete albums? Cause I allready got almost a whole album with sub albums migrated, before the problems arised.
Here is my gallery2 site: http://haagen.waade.name/gallery2/
Here is my gallery1 site: http://haagen.waade.name/gallery/
I also runned the Unit Tests, and it was abit soso. The core didn't go through, neither did Migrate:
It stopped after that.
Posts: 100
I get the following error with the latest version that i did get from cvs
Error (ERROR_BAD_PARAMETER): Missing or not readable file: /www/test-familie-berg.org/albums/.users/8
in file modules/migrate/classes/Gallery1DataParser.class at line 66 (gallerystatus::error)
in file modules/migrate/classes/Gallery1DataParser.class at line 315 (gallery1dataparser::loadfile)
in file modules/migrate/ConfirmImport.inc at line 653 (gallery1dataparser::getuserfieldsbyuid)
in file modules/core/SiteAdmin.inc at line 94 (confirmimportview::loadtemplate)
in file modules/core/classes/GalleryView.class at line 205 (siteadminview::loadtemplate)
in file main.php at line 259 (siteadminview::doloadtemplate)
in file main.php at line 24
Posts: 974
I did a little snooping on your site, and it looks like you have php-nuke, which is something that I did not anticipate. Your uids will be very different from what I am expecting. Hmm. Until G2 supports being embedded into PHP-Nuke, the migration module won't be albe to import correct user data. I can work around your problem so that all imported albums will be owned by the admin (or whomever does the importation, I think).
Thank you for testing this.
hawkin, I had written a response to you before, but then I had some sort of problem when I submitted my response, and it disappeared. I will respond again when I get home from work and can collect my thoughts.
Posts: 100
Hello jmullan,
Can you make this wordaround with a option so users can test this.
Posts: 974
Yep. Maybe not today, maybe not tomorrow, but soon, and for the rest of your life. Oops, I mean that I can't work on it right now, but that will be next, so probably when I get home, or some time after that.
Posts: 33
Hi !
I tried today's release (11.27 2003), tried to migrate my albums, and ...
- it imported my users successfully, as far as I can tell
- it started to import my albums, but after a while, it stopped. no error, but it stopped, and only part of my albums were migrated.
- I have some albums that only contains sub albums and no pix. There albums were imported correctly, but don't have any thumbnail set.
- I haven't tried it today, but last time I tried to import albums which contain titles with accents (é è ...), it didn't import them correctly.
OK, I think that's all I saw, I hope it helps to see which problems remain.
good luck guys !
sam
Posts: 45
jmullan: After 1.4.1 got released, I have updated my old gallery, and started over (erased my gallery2 data, and tried to migrate from the new 1.4.1 base).
I havent come across my earlier problem, but this time I have problems for the migration to complete. It just stops (waited like 5 minutes).
I'm looking into this, as it might be a mysql issue at our server. So don't worry about any of my problems yet
btw: it would be nice (for testing purposes) to have a link or a shortcut in the migration module to reset gallery2's data (I know the test suit from Bharat have this).
Posts: 45
My earlier problem was caused by very high load on our system. I have now tried the migration module again, and have discovered theese issues (same CVS as before):
Try to import all albums, I usually get this:
So then I descided to try each top album by itself. That worked pretty well, except two occurences. I traced it down to theese two albums (supplied with the errorcode it generated):
The last problem, I'm pretty sure is cause migrate doesnt do an check for if an album is empty (no items in the album)
Hope that helps to some extent...[/b]
Posts: 974
hawkin, you rock!
I have a feeling that tonight is going to be a special night for me and gallery2. I'll light a few candles, put on some Barry White and massage the migration module's aching code. I have a couple of things to check in, and thanks to you, a couple of relatively easy bug fixes.
For the record, I think that permissions/owners, layout-related things, and custom fields are the only items left before the feature set of the migration module is done, then it's all bug fixes and tuning (which is usually easier to hammer out, at least for me).
/me hums "You're the First, the Last, My Everything"
Posts: 45
nice to hear it helped!
One thing still missing is the import of the highlight from nested albums, correct?
give me a reply or something when u you have some CVS updated, and I'll try it out...
One idea/suggestion:
split the migration up in parts, so the script doesnt time out (for big galleries). I've seen a nice solution to this with 4images, where they have a javascript to automatic continue the script.
cheers,
hawkin.
Posts: 974
The highlight from nested albums doesn't work? Oh! I suppose that it wouldn't. Hrm. Note to self: fix that.
As to the timing out, I haven't done any optimization runs yet.
Posts: 974
well, despite my implied boundless energy, I'm afraid that my sore throat and accompanying wooziness is getting the best of me. tomorrow night, I swear.
I was at least listening to Barry White.
Posts: 974
I finally checked in a few changes.
Posts: 100
I have get the cvs from today and did try the import tools and itś working, only when i select two or more albums i get the following error.
Error (ERROR_BAD_PARAMETER): Missing or not readable file: /www/test-familie-berg.org/albums/.users/1032082730:1755202938
* in file modules/migrate/classes/Gallery1DataParser.class at line 66 (gallerystatus::error)
* in file modules/migrate/classes/Gallery1DataParser.class at line 331 (gallery1dataparser::loadfile)
* in file modules/migrate/ConfirmImport.inc at line 676 (gallery1dataparser::getuserfieldsbyuid)
* in file modules/core/SiteAdmin.inc at line 94 (confirmimportview::loadtemplate)
* in file modules/core/classes/GalleryView.class at line 205 (siteadminview::loadtemplate)
* in file main.php at line 259 (siteadminview::doloadtemplate)
* in file main.php at line 24
Posts: 974
Hmm. What version of gallery1 are you importing from?
Posts: 80
I got that error on a G2 build from last week but todays (12/14) cut worked w/o error.
This was my 1st successful attempt at doing the import. (only moved about a dozen albums). I'm on 1.4.1 RC3/php-nuke 6.9/Windows NT
If you want, you can check out the before and after:
G1: http://www.fedak.net
G2: http://www.fedak.net/modules/gallery2/main.php
Things I noticed:
- Album heirarchy is lost during import
- The matrix layout doesn't wrap captions so that the pictures stay in an evenly spaced grid
- Album header text seems to get truncated
- Some picture captions seem to get truncated
- Album dates not transferred
Very impressed with G2 thus far,
-fedak
Posts: 45
Downloaded todays snapshot myself and tried it out (14/12), and I got the same error as aavdberg:
It worked good before (6/11 CVS I think), but now it only lets me do the import of users.
PS: The file (/www/haagen.waade.name/html/gallery2/old/.users/1018307047_1755202938) DO actually exist. and It is readable. Could it be something with the parsing of the file? I'm up to date with version 1.4.1 on gallery1 side of things.
Posts: 974
Highlight from a highlighted nested album now works.
Posts: 80
I also noticed that the list of source albums for the migration is missing some of my G1 albums.
Posts: 974
Sub-albums as highlights
Fixed...
Empty albums
Fixed...
Resetting G2 data
I will give this some consideration.
International text
I'm not 100% sure about international text. G1 wasn't as firm about specifying a character set, so G1 metadata could be in any character set. G2 is UTF-8 (at my recommendation), so some stuff may or may not work right. I could simply translate any extended characters directly into Unicode html entitities, but that won't work for multi-byte characters. This is a non-trivial issue, and I want to either handle it perfectly or put the onus completely on the user to fix their data to be UTF-8 - I don't want to support only French or only Japanese.
Nuke users
I need to install a nuke of some sort and build a gallery as a module under it so I can have a good hunk of test data to futz with this.
Album ownership and permissions
Album ownership should now be correctly imported (if the owner exists or is imported first). Permissions will involve more work, but they will be possible.
Importing non-images
I tested the importation of an mpg, that worked fine. I don't know about anything else, I haven't tried.
Archive G1 data
I will be adding the ability to store the G1 data in a new field or table, so that data will be available in the future- like if we implement custom fields after everyone migrates their galleries. This is a fairly critical item.
Figure out uid weirdness
At one point, all uids in a G1 installation were 12345678:12345678, or 12345678;12345678. Recently we changed the spec to 12345678_12345678 for everyone. Hopefully every uid and the uid files should all be in the same format, but I should make sure that we can always get the user data, even if the uid is specified in one format and the file is named in the other format.
There is other weirdness where some people's user data is being listed as non-existant or unreadable. I'm not sure what is going on, and it may be a while before I get that figured out. Or maybe that will be next.
layout-related things
Unfortunately, Matrix doesn't seem to allow for things like per-album background colors. I'm not sure what to do here, but I will talk with bharat to see if this data can be saved for future use.
custom fields
This is something that I will have to talk to bharat about - if this isn't implemented in G2 I won't be able to import the data.
A lot of metadata is being left behind
There is other miscellaneous data which I should import.
Album hierarchy should not be lost unless something is really broken. This person had a lot of albums (like me), so maybe they weren't being properly parsed.
This is a matrix problem, I hope. ;)
It shouldn't be truncated. Can you double check that it isn't simply Matrix cutting off titles? Maybe when you view the album or picture the full text will show up.
I've been debating with myself about importing album modification dates. I'm pretty sure that migrating from G1 to G2 should be considered an album modification. ;)
However, I might not be picking up creation dates. I will double-check that. Click counts should be correctly imported, along with the date since we started counting clicks for that particular item. I need to doublecheck this, since I might be importing for albums only and not images, or vice versa.
Timeout issues
Since I am one of those folks with a large gallery, this is important to me, too. Right now this module has still not been optimized. I can't import my big gallery in one fell swoop. Rest assured that I will make this whole thing faster - but there might be simple limits to how fast this will work, and how much data can be imported at once.
This one is somewhat new to me - could you try this album again and let me know if you still get the error?
A HUGE thanks to everyone testing so far - it really helps to keep me focused, and to help me find those things that I might otherwise miss.
Posts: 80
Ok, did some more testing with tonight's (12/15) snapshot. Here's a summary of my findings. Some are repeats of my posting above.
- Source and destination lists all prepended with a back single quote (other places in G2 doing this, so may not be a migration issue)
- Missing Albums: There appears to be a point in my albumdb.dat after which no additional albums are being loaded.
Curiously, there seems to be a newline in the debug trace for the first nonsuccessful album that does not exist on any other:
file_exists(c:\nuke\html\modules\gallery\albums\washingtonconstruction/\album.dat)
is_readable(c:\nuke\html\modules\gallery\albums\washingtonconstruction/\album.dat)
file(c:\nuke\html\modules\gallery\albums\washingtonconstruction/\album.dat,
)
file_exists(c:\nuke\html\modules\gallery\albums\disney97/\album.dat)
I did a cursory check of the album.dat and albumdb.dat and I'm not seeing anything amiss.
- On most of the albums, the "Album Title" does not appear on the import confirmation screen.
(for example album xmasweek2002 does not work, where xmas02john does)
- When I try to cancel an import, I get the following error:
Error (ERROR_BAD_PARAMETER): Missing or not readable file: c:\nuke\html\modules\gallery\albums\1\album.dat
in file c:\nuke\html\modules\gallery2\modules\migrate\classes\Gallery1DataParser.class at line 66 (gallerystatus::error)
in file c:\nuke\html\modules\gallery2\modules\migrate\classes\Gallery1DataParser.class at line 210 (gallery1dataparser::loadfile)
in file c:\nuke\html\modules\gallery2\modules\migrate\ConfirmImport.inc at line 673 (gallery1dataparser::loadalbumfields)
in file c:\nuke\html\modules\gallery2\modules\core\SiteAdmin.inc at line 94 (confirmimportview::loadtemplate)
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryView.class at line 205 (siteadminview::loadtemplate)
in file c:\nuke\html\modules\gallery2\main.php at line 259 (siteadminview::doloadtemplate)
in file c:\nuke\html\modules\gallery2\main.php at line 24
This file is indeed missing.
- Some, but not all, of my albums are getting the (much discussed) bad parameter error
Trying to import the fall2002 album:
Error (ERROR_BAD_PARAMETER): Missing or not readable file: c:\nuke\html\modules\gallery\albums\.users/1035764569:1165877984
in file c:\nuke\html\modules\gallery2\modules\migrate\classes\Gallery1DataParser.class at line 66 (gallerystatus::error)
in file c:\nuke\html\modules\gallery2\modules\migrate\classes\Gallery1DataParser.class at line 331 (gallery1dataparser::loadfile)
in file c:\nuke\html\modules\gallery2\modules\migrate\ConfirmImport.inc at line 702 (gallery1dataparser::getuserfieldsbyuid)
in file c:\nuke\html\modules\gallery2\modules\core\SiteAdmin.inc at line 94 (confirmimportview::loadtemplate)
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryView.class at line 205 (siteadminview::loadtemplate)
in file c:\nuke\html\modules\gallery2\main.php at line 259 (siteadminview::doloadtemplate)
in file c:\nuke\html\modules\gallery2\main.php at line 24
The "1035764569:1165877984" file does not exists, though it is what appears as the owner in the album.dat for the album.
A 1035764569_1165877984 file exists instead.
I opened the album in Gallery1, brought up the permissions window, and saved it. This seemed to fix
the data inconsistency and allowed me to import the album without getting the above error.
Not sure where that user came from. I'm not a heavy user of users/permissions (basically have a single user
that I've used for all the albums) Looks like others are having the issue though. May be a bug with the
migration or with one of the Gallery1 upgrade scripts along the way.
- Need to cleanly handle the case where the G2 album directory already exists. Throwing ERROR_COLLISION now.
- Ran a long import (30-40 albums) and eventually got the following error. It did successfully import all of the
albums, so I'm wondering if this was not an issue with the import rather than a timeout of some sort.
Error (ERROR_PERMISSION_DENIED):
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryUserHelper.class at line 193 (gallerystatus::error)
in file c:\nuke\html\modules\gallery2\modules\core\SiteAdmin.inc at line 46 (galleryuserhelper::assertsiteadministrator)
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryView.class at line 205 (siteadminview::loadtemplate)
in file c:\nuke\html\modules\gallery2\main.php at line 259 (siteadminview::doloadtemplate)
in file c:\nuke\html\modules\gallery2\main.php at line 24
This left G2 in a corrupted state. Navigating to main.php then threw the following error:
Warning: rename(c:\nuke\gallery2\tmp\img5322.tmp,c:\nuke\gallery2\cache\1/164): File exists in c:\nuke\html\modules\gallery2\modules\core\classes\GalleryPlatform.class on line 355
Error (ERROR_PLATFORM_FAILURE): Failed renaming c:\nuke\gallery2\tmp\img5322.tmp -> c:\nuke\gallery2\cache\1/164
in file c:\nuke\html\modules\gallery2\modules\imagemagick\classes\ImageMagickToolkit.class at line 268 (gallerystatus::error)
in file c:\nuke\html\modules\gallery2\modules\imagemagick\classes\ImageMagickToolkit.class at line 120 (imagemagicktoolkit::_transformimage)
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryDerivative.class at line 522 (imagemagicktoolkit::performoperation)
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryDerivativeImage.class at line 169 (galleryderivative::rebuildcache)
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryDerivativeHelper.class at line 553 (galleryderivativeimage::rebuildcache)
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryDerivativeHelper.class at line 531 (galleryderivativehelper::rebuildcache)
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryDerivativeHelper.class at line 487 (galleryderivativehelper::rebuildcache)
in file c:\nuke\html\modules\gallery2\layouts\matrix\layout.inc at line 276 (galleryderivativehelper::rebuildcacheifnotcurrent)
in file c:\nuke\html\modules\gallery2\layouts\matrix\layout.inc at line 124 (matrixlayout::_loadalbumtemplate)
in file c:\nuke\html\modules\gallery2\modules\core\ShowItem.inc at line 98 (matrixlayout::loadtemplate)
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryView.class at line 205 (showitemview::loadtemplate)
in file c:\nuke\html\modules\gallery2\main.php at line 259 (showitemview::doloadtemplate)
in file c:\nuke\html\modules\gallery2\main.php at line 24
Deleting all the files in gallery2\tmp cleaned this up.
- Subalbums that imported all ended up at the root level rather than under the correct parent.
- No "Date:" on imported albums. View count, descriptions looks good.
- G1 caption going to G2 "title". Not sure what everyone's opinion is, but I'd at least like the option to map caption->description instead of title.
Some of my captions are several paragraphs long and the default layout seems to be expecting shorter text for this field. Description field
seems to be getting filename in some cases so these may be swapped.
- Summary and caption text are definately being truncated. This may not be an import issue, as the G2 gui appears to be truncating them too.
*Much* too small to contain the text I have in these fields.
- General (non-import) G2 issues/comments. Ignore if these are known issues, intentional, or items that aren't finished yet:
- Album "Summary" edit block *way* too small. Needs to be similar in size to G1 block
- Album Summary, Captions, Descriptions etc do not allow you to enter raw html (and have it treated as such in G2).
Would very much like to be able (like in G1) to enter html into these fields. HTML entered in G1 imports fine so this
appears to be an editior issue rather than a backend issue.
- The position of "parent level" drop-down in the bottom left isn't terribly intuitive and can potentially be offscreen.
- Parent level dropdown sometime has odd effects. (For example, "delete album" from the album screen brings up a list of
images.
- Matrix layout not an even grid on large screens (left column left justified, other two columns right justified)
- Main album page does not keep text in an even column (for example, a landscape photo will cause indented text)
- 50 albums w/ G2 noticably slower than 200+ albums on G1
- Cancel doesn't seem to work from most of the sub-item list pages (ie 'delete item', etc)
Still very impressed with the effort thus far, keep up the good work all...
I'd be happy to provide any of my data files and/or give you access to the system if it will help testing/issue resolution.
G1: http://www.fedak.net
G2: http://www.fedak.net/modules/gallery2/main.php
-fedak
Posts: 7994
Let me address these points since they aren't migration related (so they aren't necessarily things that Jesse is familiar with).
In G2, the summary is limited to 256 characters. It's a summary, not a description so it's probably going to remain that way. We may make the text box larger in the GUI for ease of use (there's still a lot of GUI polishing left to do!) but the goal in G2 is to get finer grained control over the data which is why we've split the concept of a "caption" out into title, summary and description. The description field is virtually open ended (depends on the database, but most dbs can handle 64K of description data).
This is for security reasons. The current plan is to allow you to enter BBCode (similar to what we use here in the forums). This will give you a reasonable level of HTML beautification without opening the door for any nasty cross-site-scripting security issues that plague apps like this. We'll probably add a global setting to allow you to enable raw HTML, eventually.
That's controlled by the layout (and we have the concept of interchangeable layouts) so it's something that will be easily changed in the future. Again, unpolished. Give that a little time.
Yep, this is a known issue on my radar. I'll fix it pretty soon.
More unpolished Matrix layout issues -- this will get fixed in about a month (we have to do some other stuff first).
G2 creates the images on demand then caches them. So the first time you view a thumbnail you have to wait for it to be created. Subsequent page reloads should be significantly faster. It'll still be a little slower than G1, but it'll maintain that same speed as you get up to 100K images (where G1 performance will drop off dramatically over about 15-20K images). Also, I still haven't done any optimization -- I expect a 1.5-2x speedup before we get to alpha.
Right .. I actually don't know where to take you if you cancel at that point. There's no general purpose landing page if you cancel from that point since you can get there from different places. Any thoughts on that?
-Bharat
Posts: 80
Hmm, in this case it would be nice for the migration to give you the option of mapping the summary to the description- or at least warn you that you're losing data in your translation.
Cool, BBCode will handle most of what I want to do. (And I'm assuming it'll be a simple hack to turn the validation off if I want to)
Hmm, an option to pre-cache everything might be nice- but definately not a high priority.
Well, the ideal solution would be to track the referring page and send you back there. Realize the implementation issues involved in this.
Since I've already threadjacked this topic. a couple of procedural questions:
Are you yet at the point where you'd like to see G2 bugs logged? I was poking around sourceforge and didn't see much in the way of G2 stuff. (it's possible I wasn't looking in the right place). I've started poking around in G2 and started finding things that should probably be logged.
BTW, are the unit tests expected to run on windows? The UtilitiesTestPlatform class is hardcoded to be unix-esq and thus the testconvertpathtourl test cannot pass on NT. (Also because the $galleryBase setting in init.php is postfixed with a unix path seperator)
-fedak
Posts: 974
fedak: could you make sure that you have upgraded absolutely every album in G1?
Also, due to the large number of albums that you are importing, I think that you might be out of luck until a major optimization of the migration module (which will happen). I'm in the same boat.
As to loss of caption data... I'm not sure what the best approach to take would be. I have a lot of long captions myself, so again, I'm in the same boat.
I would suggest that you take general G2 comments into a new thread. Go nuts! We love the feedback. It is cluttering up this thread a little, but I will live. ;)
Posts: 80
Not quite clear on what you're asking. Are you asking me to try to upgrade all of my G1 albums to G2? Or are you asking me to somehow validate my G1 albums?
-fedak
Posts: 7994
Yea .. that's been in the back of my mind for a while. It's definitely possible (there's a framework for doing this which is how the login link always returns you to the same page after you've logged in) but I'm going to let it simmer for a while longer and see if a more elegant answer naturally emerges.
Yep, there's a "v2.0-pre-alpha" group in the bug tracker on the SF.net project page -- log your bugs with that group and I'll take care of them. Thanks!
Yep, it should work on Windows but I haven't tried it lately so there are probably a few little things that I've changed recently that have broken windows support. File a bug about that, would you please? I'll fix it when I get a chance.
Don't worry about the unix path separators or even the weird intermingling of unix and windows path separators when you're using windows -- PHP is smart enough to do the right thing with those. Thanks for the report, though!
Posts: 974
fedak,
If you upgraded to 1.4.1 at some point, it is possible that not all of your albums were upgraded, especially with the number of albums that you have. I have strong doubts that the recursive upgrade would have worked. Have you visited every album since the upgrade?
I just need to make sure that we cover all of the obvious things.
Would you mind sharing your .dat files with me? I can give you a command to feed to tar and gzip that should pick up just your .dat files. (or maybe you could use the backup tool).
Please let me know. Thanks a bunch!
Posts: 80
Yeah, I'm on 1.4.1 (and have incrementally been on every released version for the past ~2 years, so it's quite possible that I've aquired some baggage). Its quite likely that I've not visited all of my albums since my 1.4.1 upgrade.
Is there a quick way validating the integrity of my G1 album heirarchy? Going to somewhat suck having to manually navigate to 200+ albums. Seems like some form of preflight validation on the G1 structure would save alot of future headaches.
I'll PM you with a read-only ftp to my G1 directory. Can get you a zip of my .dats when I get home this evening if you'd like that as well.
-fedak
Posts: 974
Do you have shell access? Well, seemingly of course you do. ;) Do you have ksh? I made a ksh script that would request every album via wget (thusly making sure that they all get updated).
Of course, I don't have it at work.
Posts: 80
Shell access, yes. Ksh no (it's a windows box).
Send me the script and I'll see what I can do. I should be able to port it over to a bat file (or worst case install a windows version of ksh)
-fedak
Posts: 80
Tonight's build appears to be stillborn, as there's an expression w/ unbalanced parens:
Parse error: parse error, unexpected T_BOOLEAN_AND in c:\nuke\html\modules\gallery2\modules\migrate\classes\Gallery1DataParser.class on line 267
From Gallery1DataParser.class:
if (!isValidUid($username))
&& !eregi('nobody|everybody|loggedin', $username)
&& isValidUid($uid)) {
$uids[$uid] = $username;
}
also...
- selectPath() javascript produces incorect result or errors on windows since the backslashes in the paths
are treated as escape characters when evaluated by the js interpreter. (Logged a bug on this as it
appears in other places besides the migration module)
- If you omit the trailing slash from the G1 album directory, it passes validation as a valid directory, but
the code then tries to glom the .users directly onto the directory name w/o adding a slash:
Error (ERROR_BAD_PARAMETER): Missing or not readable file: c:\nuke\html\modules\test_gallery\albums.users/userdb.dat
in file c:\nuke\html\modules\gallery2\modules\migrate\classes\Gallery1DataParser.class at line 66 (gallerystatus::error)
in file c:\nuke\html\modules\gallery2\modules\migrate\classes\Gallery1DataParser.class at line 260 (gallery1dataparser::loadfile)
in file c:\nuke\html\modules\gallery2\modules\migrate\ChooseObjects.inc at line 88 (gallery1dataparser::getuseruids)
in file c:\nuke\html\modules\gallery2\modules\core\SiteAdmin.inc at line 94 (chooseobjectsview::loadtemplate)
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryView.class at line 205 (siteadminview::loadtemplate)
in file c:\nuke\html\modules\gallery2\main.php at line 259 (siteadminview::doloadtemplate)
in file c:\nuke\html\modules\gallery2\main.php at line 24
Posts: 974
Sonofa!
Hrm. I may end up having to install G2 on a windows box to work on it.
Posts: 80
Not sure if this is a G1 or migration issue:
1) Create an empty G1 1.4.1 gallery
2) Create an album
3) Rename the album
4) Try to migrate the album
When renamed, The albumdb and the actual directory tree will be renamed with the new album name. However, the album's album.dat file will still have the old name. The migration module uses the name from the album.dat file, and then errors out when the directory doesn't exist.
-fedak
p.s. bharat's changes today seemed to fix the unbalanced parens issue above
p.p.s. Have a couple migration unit tests failing w/ tonight's build. If these are supposed to be currently working, let me know and I'll investigate further
Posts: 974
That's a G1 issue, and I filed a bug report and partial patch. I need to chat with the G1 leads to get the update worked into the upgrade_albums process, since all albums will have to be fixed. This is a terrific catch, and will probably fix a few sneaky bugs that we may or may not have been previously catching.
Of course, it does mean that in order to migrate one's G1 gallery, one will probably have to upgrade to 1.4.2 first. That isn't necessarily a bad thing, but it might be irritating to some users.
I still have the upgrade problem rolling around the back of my head - how to upgrade all albums without using the recursive tool on a windows server. Do you have cygwin or any unix tools available? Unix find and wget could probably do the work, even in a windows environment (while running natively from the command line).
You could conceivably download your AlbumDB.dat file and hand edit it into a .bat file to request every album via wget. You could install the php windows binary and custom code something to read a locally saved AlbumDB.dat file and request each album in turn.
That might be a fun php-gtk project. Hmm. I've been meaning to futz with that.
I really don't know how I convinced myself to make that cvs commit without running through the validation process. The latest build should be fixed.
Posts: 80
I'm not sure what you've committed to, but I don't think it's unreasonable to expect people to upgrade to the latest version of 1.4.x before going to 2.x. You'll go crazy trying to support migration from every 1.x dot rev and you'll just be duplicating the n->n+1 upgrade code that they need to write for G1 anyway. The ERP community has to deal with this issue on a regular basis.
Since the albums are not store heirarchally, resursion really shouldn't be necessary, should it? Assuming things aren't highly messed up, you should just be able to list the subdirectories of the album directory and convert the subdirectory names into urls.
Happens to the best of us We've got a gold spray-painted plunger that gets passed to the latest person to do it.
-fedak
Posts: 974
Exactly. The tool inside gallery is recursive, I think (but it might not be, because it doesn't have to be).
I don't know your level of experience (but it does seem high). A lot of users want to be given the tools to do things, some want to write the tool themselves but need a push, and some just figure things out on their own. Some people are willing to go out and get whatever tools they need, and some want to use what they know already. I'm just trying to provide enough context that you can decide what you want to do. I have a ksh script written already, but that's it.
Whatever you use to request each url does not need to be logged in to upgrade individual albums. Any request of an album will upgrade it (unless there is a problem).
Posts: 80
Ok, did a little more testing last night...
- Unit tests are all passing again with the 12/19 cut from your server.
- Here's a new one from my ad-hoc testing:
Sort order lost during migrations:
1) Start w/ empty G1
2) Create album01 at root
3) Create album02,album03 as children of album01
4) Move album03 before album02
5) Migrate to G2
G2 gallery will have 02,03 order instead of 03,02
- I was able to use wget and fetch each of my albums, so whatever issues that was expected to address should now be resolved. (In the process, found a hole in my mod_rewrite regex so it was a worthwhile effort in any case)
With that done, I attempted to remigrate:
a) Real nitpick here: I imported my 1 user (successfully) and got the following message from the system:
(Note the conflicting 'Successful' and 'No users imported' messages
Import Complete
Successfully imported 1 user.
Imported fedak
No users imported.
Import more data
b) Still not getting a full list of my albums on the "Select albums to import" and still not getting titles for most of my albums on this same page.
Were you able to glean anything from my albumdb.dat/album.dat files?
c) Getting the following error when attempting to import any album from my main G1 system (migration *is* working fine from my test G1 install, so not a core migration problem)
Error (ERROR_LOCK_TIMEOUT):
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryStorage\DatabaseStorage.class at line 808 (gallerystatus::error)
in file c:\nuke\html\modules\gallery2\modules\core\classes\Gallery.class at line 556 (mysqldatabasestorage::acquirereadlock)
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryItemHelper.class at line 663 (gallery::acquirereadlock)
in file c:\nuke\html\modules\gallery2\modules\migrate\ConfirmImport.inc at line 494 (galleryitemhelper::setthumbnailfromitem)
in file c:\nuke\html\modules\gallery2\main.php at line 146 (confirmimportcontroller::handlerequest)
in file c:\nuke\html\modules\gallery2\main.php at line 24
It appears to create the album successfully, but crashes partway through the creation of the first picture.
d) HTML tags stored in the summary/caption fields in G1 now appear to be getting explicity rendered in G2. Yuck.
(If we're only going to support bbcode in G2, I've got a rather big migration problem with all of the html in my captions and summaries.)
Posts: 974
fedak=awesome!
Excellent.
I'm aware of that. I'm hoping to get a change into G1 so that I don't have to use the very expensive G1 process to determine album order. For the moment you will just have to suffer. ;)
Excellent. Did you write a script? I put together a php-gtk app to do the same thing last night, and then tested it on your site. I think that I will make a php-cli version too, then package those and the ksh script together to provide some easy options for users of large galleries. It is critical that all albums are updated so that uids are up-to-date everywhere in G1.
That's a new one. I will look over that code. Thanks!
No, I have them, but haven't done anything with them as of yet. I think that I need to use bharat's album data spider tool to validate everything. Or maybe it's just the $album->fields['name'] thing, which is a sneaky but critical bug (at least as far as the migration module is concerned).
I think that may have something to do with the number of albums that your main gallery has. Does this happen when you try to import just a handful of albums, or only when you do a large mass? I need to review the locking mechanisms too, because I'm really not that familiar with how they work.
Since bharat just set up the BBCode thing, I will likely be converting html to BBCode. This will probably be user-selectable. I will be doing similar things to try to convert extended characters into UTF-8, but I don't know how wise that process will be.
Also, at some point I will be adding a piece to the database to store all of the old album and image metadata, so that we could conceivably parse it at a later date when additional features are implemented.
I've got a long long task list. Thanks again for all your testing work!
Posts: 80
A script, but not a very smart one. The most expedient path was to just pipe the directory list to a text file and do some regex search and replace in a text editor to generate the wget statements. Crude but effective.
Got the error when importing a single album (didn't even try to do a big chuck after that.) Tried it with a number of different albums, and all failed in the same manner. Imports from a clean copy of G1 worked fine, so its something w/ my big G1 thats causing the issues.
Just trying to contribute my fair share. Have a vested interested in getting this thing working.
-fedak
Posts: 80
Ok, found and resolved the issues that were causing my incomplete album list and missing title problems:
There were case issues with some of the parentAlbumName fields in my album.dat files. (i.e. the strings were correct, but with incorrect cases.)
Since the migration module builds it's tree by using the backwards (subalbum->album) link, it was unable to attach these subalbums to the tree. (An error message in getAlbumHierarchy for when isset($tempAlbums[$parentName]) returns false would really help matters here)
I'm not sure exactly when/how this happened, but I've had case issues with G1 at various points along the way- usually due to mod_rewrite doing ugly things to my urls. Since the windows filesystem isn't case sensitive, I've just changed the G1 lookups to strcasecmps to get it working. Looks like this just came back to bite me.
Wrote a little php routine to do a top down traverse of the G1 tree and set the parentAlbumName from the parent album's name. If anyone needs it, it can be found here: http://www.fedak.net/modules/gallery/fix_album_parents.txt. (Use at your own risk, this is the first thing I've ever written in php )
-fedak
Posts: 974
I thought that it was weirdness like that, but I was following the fields['name'] road. It turns out that shouldn't have been a problem for most galleries (because loading and saving a faulty album would fix it), but I fixed it in the import process too.
I will look into the parent album thing - I have your data, I should be able to set up a test tree to futz with and find a good way to error out.
If you are successfully importing albums then I will move on to another blocking bug - most likely the lock timeout thing.
Posts: 80
Back from vacation and had some time to play with the latest dev build. Things are looking much better, and I was able to migrate some albums again.
G1: http://www.fedak.net/
G2: http://www.fedak.net/modules/gallery2/main.php
- There's two places in Gallery1DataParser.class where a path containing a hard coded '/' gets passed to loadAlbumFields. This causes the import to fail on windows. (The album names come back with '/' appended to them). Changing them to '\\' fixes the issue on windows. Code needs to be modified to use $slash.
- With the above issue fixed, I was able to successfully import albums (the ERROR_LOCK_TIMEOUT from before the holidays appears to be fixed). This error may have been caused by me not having netpbm/imagemagick configured after a reinit- the migrate module seems to require these modules but does not check for their activiation.
- My "YosemiteWeekend" album is being migrated w/o a highlight thumbnail. This album contains only subalbums.
- Getting the following error migrating my "SonoraStanislaus" album tree. I'll look into this over the next day or two and make sure it isn't a data issue with my album files.
Error (ERROR_COLLISION):
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryAlbumItem.class at line 203 (gallerystatus::error)
in file c:\nuke\html\modules\gallery2\modules\core\classes\GalleryAlbumItem.class at line 122 (galleryalbumitem::_createdir)
in file c:\nuke\html\modules\gallery2\modules\migrate\ConfirmImport.inc at line 272 (galleryalbumitem::create)
in file c:\nuke\html\modules\gallery2\main.php at line 146 (confirmimportcontroller::handlerequest)
in file c:\nuke\html\modules\gallery2\main.php at line 24
- Custom thumbnails (i.e. ones generated using the G1 java thumbnail editor) are not preserved during migration
-fedak
Posts: 974
That's weird - I thought that php under windows didn't actually care. Oh well, it was on my mental list somewhere to fix this. Now it's on an actual list.
Good catch, although I think that there may be more to it than just that.
That's unexpected, but I think that I haven't fully tested the "highlight from sub album" parts. I need some unit tests for that (but the unit test for that would probably be very complex).
Hmm.
That's in the list of fields to import. Perhaps I should enumerate a specific list of the tasks that still need to be done. Jeez this is a huge module. I really had no idea.
Posts: 974
The following list is in the source of ConfirmImport, and is my checklist for metadata.
LEGEND:
+ done (or something approximating done)
- will not do
I must admit that I have been very distracted by the holidays.
Posts: 974
Finally:
[/]
Posts: 80
PHP itself doesn't care, the issue here seems to be with string manipulation of album paths rather than with using the php functions for file access.
My preference for this would be some user settable control of the field mapping. Specifically, I'd like to map the G1 item captions -> the G2 item description, G1 filename -> G2 item title, G1 album summary -> G2 album description.
-fedak
Posts: 974
Done:
Todo:
[/]
[/]