One album lost its comments after move, comments link to "missing object"

Hello, and thank you in advance if anyone can help me. I moved my website to another host, and I see that the images in the newest album have lost all their titles, descriptions and comments. Titles and descriptions I can redo easily but I'd like to get the comments back. All the comments are still visible in the admin comments section however they link to a "Missing Object" instead of an image. How can I link them back to the images? There's probably not more than 25ish of those in total, so I would do them manually one by one if I only knew how.
Any help greatly appreciated.

Comments

  • This is most likely because you either did not move the database or if you did you gave the new install a different database prefix.

    If you still have the old install you can make a backup of the database and re-import it in the new install.

    See also the "Moving Installations" section in http://www.zenphoto.org/news/installation-and-upgrading
  • zigg Member
    I did move the database following the "Moving installations" section, and all the albums moved fine, with titles and descriptions and comments showing how it's supposed to be, except for one. By albums I mean the different folders in the gallery.. So I'd like to fix that one broken album, is there a way to manually tell the database that this comment belongs to this picture? Because the pictures are there - they're showing up on the website, and the comments are there - they're showing up in the admin comments section in the comments list. But the comments don't relate to the images, in the column where it says what image the comment is for, it only says Missing Object in bold. So my question is how can manually tell the comment which image it belongs to? Would I have to go to phpMyAdmin? but what do I do there?
    Sorry if I'm not making myself clear, I'm not much of a programmer :(
    Thanks for you answer though.
  • zigg Member
    Looking at the database, it seems like images got two lines each, one old line with the titles and comments and everything and one new line, which is empty. Like this:

    Edit Delete 953 19 IMG_3213s.jpg Drawing In the Aquarium
    Edit Delete 1126 23 IMG_3213s.jpg IMG_3213s NULL

    the gallery is showing the empty image http://eigene.org/album/2012-misc/IMG_3213s.jpg.php , what's the correct way to fix it? delete the new line in the database? I'm afraid to experiment, I don't want to wreck it!
  • What is the "owner" column for both those images? Is it the same? I wonder if the database was broken before the move.

    Did you use the backup/restore method of moving the database? If so, the root of the problem probably was in the old db.

    The comments have an "owner" column. It should point to the image for which the comment was made. Does it point to the correct one of those image entries?

    Was this newest album part of the old installation or was it introduced on the new one?
  • zigg Member
    I created an empty database and imported the old database backup file. I did run the setup after moving all the files but I don't remember if there was a backup/restore involved.. I was so stressed that it won't work! sorry :(

    The newest album was created still under the old host, so I'm not sure why it was the only one that got messed up. There have been new comments made after the move though, which do show up.

    Let me try to find an image with new comments which also had old comments... Let's say this one: http://eigene.org/album/2012-misc/IMG_3183s.jpg.php

    so the images uh.. is it called table? (don't laugh! I'm but a housewife..) in the database has this:

    Edit Delete 954 19 IMG_3183s.jpg Testing ---> original entry, not showing up
    Edit Delete 1124 23 IMG_3183s.jpg IMG_3183s --> new line, shows up, but it doesn't have titles nor anything

    the comments table (?):
    ID OwnerID
    Edit Delete 783 954 Daiva 2012-04-15 16:42:55 Elija, you are so beautiful!!
    ----> old comment, not showing up

    Edit Delete 835 1124 kamile 2012-07-24 16:59:35 I like this picture
    ----> new comment, DOES show up

    So I sort of see what the problem is, but how do I safely fix it? Should I edit and change the ownerID on the old comment? But what about the double entry in the images table? Delete the new one? or the old one?

    Thank you VERY much for helping me.
  • I really needed to know about the owner column in the images and Ownerid in the comments to be able to make a guess as to what you should do to correct.

    But generically you would remove the images which do not "point" the the proper album with their owner field. And the comments would need their ownerid changed to the id of the image to which they really belong.

    When you say you "imported the old backup file" did you use Zenphoto to do this or did you use your database software?
  • zigg Member
    Ugh - I made an effort to copy everything and didn't notice the spacings got messed up in the previous post, so nobody can understand :( sorry. I was trying to show that original entry image ID is 954, but there's a new line for the same image with ID 1124. New comments have owner ID 1124, old ones have owner ID 954. Old ones don't show up.

    So now I will change the owner ID for the new comment to 954 and delete the whole line of image data with ID 1124 so only the original line with 954 is left? Deleting the line won't delete the image or.. crash the whole thing? Sounds easy. Although I'll wait for confirmation if that's really what I need to do :)

    I imported the database file through phpMyAdmin.

    Thank you again!!
  • acrylian Administrator, Developer
    You should use the Zenphoto's own database backup tool as described on the instructions above. You need to exactly follow the order described.

    You find that tool on the admin overview page. Of course only on current Zenphoto versions (I don't remember when it was introduced, I think around 1.3 - and you did not say which you use).
  • Deleting the "new" entry and changing the owner of the old entry should work. Wht this indicates is that there appeared to be a change in the album name. Perhaps a change if "case" in the name or something like that.

    You can look at the albums table. If there still is a redord with the id 954, then that is the original album. If not, then for some reason Zenphoto thought the album was "new".
  • zigg Member
    Yes that was it, old image data was linking to album 19, and there was no album 19 in albums table, the album in question had id 23. I lost a couple comments in process of realizing to edit the comment lines BEFORE messing with image lines (or else the comments just disappear) but I think I fixed all the images now! SO happy! Is that how the real programmers feel when their project works? If so maybe I should look into becoming one haha

    Thank you very very much for helping me!
Sign In or Register to comment.