Reinstalling Zenphoto corrupts the database

Hello,

I had to migrate my zenphoto (1.4.3.3) from a host to another (because a server issue that couldn't be resolved). I precise that zenphoto was totally inacessible, I couldn't migrate to 1.4.7 before changing the hosting. I managed to backup my albums (via FTP) and the databases(via PHPmyadmin).

On the new host, I've restored albums and database, then I've installed the 1.4.3.3 version as before. The move was a success, everything works well, I plan now to upgrade to the 1.4.7 version.

I've only one big problem : installing zenphoto (1.4.3.3) corrupts the database. 90 on 750 lines of the 'zen_images' table have been messed, i.e the columns' contents are mixed (or something like that). For example : all the image titles of these 90 lines have been filled by the camera model, others are NULL...

What's happens ? Some advices or ideas are welcome.
I precise that : 1/ the SQL dump is clean ; 2/ if I directly install the 1.4.7 version (without the 1.4.3.3 step), the problem is the same.

Thanks in advance,

JC

Comments

  • acrylian Administrator, Developer
    Sorry for the problems. I installed 1.4.7 on various standard shared webhosts without ever encountering such issues …

    How did you dump the database? Zenphoto's own database backup tool (I think that is already in 1.4.3.3) or via phpMyAdmin or the like. If using Zenphoto's own tool try to set compression to 0 (disable it). You should not import an older version database to a newer version (it is noted there but I just mention it).

    We recommend step by step updates as noted on our upgrade page as we don't test updates from older versions directly. So 1.4.3 > 1.4.4 > 1.4.5 > 1.4.6 > 1.4.7 (with 1.4.7 we changed version numbering, it is compatible directly with 1.4.6)

    Please review all error logs, ZP has a setup log, and post any errors here.
  • archi02 Member
    Thank you very much for your quick reply.

    I dumped the database from phpMyadmin, I haven't thought about zenphoto's own backup tool. I'll try that (and also upgrading version by version, but, once again, it was not the upgrading process that have corrupted the db but the 1.4.3.3 reinstallation).

    I'll keep you informed.
  • acrylian Administrator, Developer
    The mysql dump via phpmyadmin should generally work too since it is a plain dump, but the step by step upgreade is needed because of any database changes.

    The database corruption should not happen but maybe be related. No real other idea right now though.
  • archi02 Member
    I don't understand.

    TEST 1. The zenphoto dump is clean (autodumped from 1.4.3.3). If I restore it (with the backup tool) on a fresh 1.4.3.3 install, the database is corrupted.

    TEST 2. On a 1.4.3.3 fresh install and blank database, I import a clean SQL dump. I check : everything is ok. I browse the gallery, and images titles are weird. I check again the database, it's now corrupted.

    TEST 3. On a 1.4.3.3 fresh install and messy database, in PhpMyAdmin I drop the corrupted zenphoto_images table (only this one). I replace it with a clean zenphoto_images table. I check : the operation is successful, after log out/log in, the database is now clean. Then, I browse the public interface of the gallery, and I notice that lot of images titles are still wrong. I check once again the database via phpMyadmin : it's corrupted !

    This makes no sens.

    ## EDIT

    I've a clue in addition. The number of messy lines in the zen_images table is growing up over time. More precisely : more I browse my gallery, more lines are impacted.

    So, let me make an hypothesis : could the database corruption be linked (in one way or another) with the thumbnail process ?
  • archi02 Member
    (with thumbnail process or with cache process, by the way)
  • archi02 Member
    TEST 4. On a 1.4.3.3 fresh install and blank database, I import the SQL dump via PhpMyAdmin, and before browsing the gallery I force the construction of images cache and thumbnails (via zenphoto cache manager), default options. I check : the database is corrupted.

    The link between the corruption and the cache process seems pretty clear...

    ## EDIT
    TEST 4a. Still on a 1.4.3.3, I try again to construct the image cache. But only check the 'admin_40_cw40_ch40_thumb' option. The db est corrupted.

    TEST 4b. I try again to construct the image cache. But only check the 'default_595' option... (in progress)
  • archi02 Member
    TEST 4b. The db est corrupted.

    TEST 4c. I try again to construct the image cache. But only check the 'default_100_cw100_ch100_thumb' option. The db est corrupted.

    I have no more idea for the moment...
  • acrylian Administrator, Developer
    The image caching itself has nothing to do with the database itself, it is a pure file system operation and is not stored there. However Zenphoto's gallery is file system based and matches file system with the database entries. It is not necessary to re-generate the image cache.
    http://www.zenphoto.org/news/caching

    You hopefully followed our upgrade / move instructions. The order to first move the albums to the new install and then import the database is important. Otherwise ZP deletes entries from the database that don't exist on the file system:
    http://www.zenphoto.org/news/installation-and-upgrading#moving-existing-installations

    I have no idea why your table messes up. Did you by now check the error logs and that the database is really setup correctly?

    Other than that I have no idea currently, sorry.
  • archi02 Member
    Here is my setup.log (if you don't read french, note that the only warning concern an potential upload problem, certainly because all files have not the same timestamp [I've done a lot of tests]).

    ####
    Script d’installation de Zenphoto v1.4.3.3[10902] : Mon, 18 May 2015 10:13:00 +0000
    Avertissement :Il y a peut être eu un problème lors du chargement vers le serveur. Vous devriez vérifier les fichiers suivants :zp-core/setup.phpzp-core/setup/setup-functions.phpzp-core/setup/setup-option-defaults.phpzp-core/setup/setup-primitive.phpzp-core/setup/setup-sqlform.phpzp-core/setup/setup.csszp-core/setup/setup_permissions_changer.phpzp-core/setup/setup_set-mod_rewrite.phpzp-core/setup/setup_themeOptions.php
    Vérification du système complétée
    Configurer les réglages par défaut de Zenphoto
    Note : le module « mod_rewrite » fonctionne. L’option « mod_rewrite » de Zenphoto est désactivée.
    Le paramétrage des défauts du thème default a commencé
    Gestionnaire de paramètres de default instancié
    Le paramétrage des défauts du thème default est terminé
    Le paramétrage des défauts du thème garland a commencé
    Le paramétrage des défauts du thème effervescence_plus a commencé
    Le paramétrage des défauts du thème stopdesign a commencé
    Le paramétrage des défauts du thème zenpage a commencé
    Gestionnaire de paramètres de stopdesign instancié
    Gestionnaire de paramètres de garland instancié
    Gestionnaire de paramètres de effervescence_plus instancié
    Le paramétrage des défauts du thème stopdesign est terminé
    Gestionnaire de paramètres de zenpage instancié
    Le paramétrage des défauts du thème garland est terminé
    Le paramétrage des défauts du thème effervescence_plus est terminé
    Le paramétrage des défauts du thème zenpage est terminé
    Le paramétrage des défauts du thème zpmobile a commencé
    Gestionnaire de paramètres de zpmobile instancié
    Le paramétrage des défauts du thème zpmobile est terminé
    ####

    TEST5. I tried to restaure db on a 1.4.3.3 fresh install at home (on localhost). Nothing change, the database is corrupted.
  • acrylian Administrator, Developer
    The log as far as I see looks good (I indeed don't read French ;-))

    I tried to restaure db on a 1.4.3.3 fresh install at home (on localhost). Nothing change, the database is corrupted.
    If you use a backup from a already broken database it of course stays corrupt, just to mention.

    Maybe the database is really corrupt itself and it is all no fault of Zenphoto. Or some MySQL configuration itself. It could also be that your images stored EXIF meta data wrong and ZP imports it wrong therefore. Maybe check your images itself for that, too.

    Other than that I am sorry, I have no clue what is happening.
  • archi02 Member
    Ok, I've found a workaround : after manually cleaned the zenphoto-images table, the problem's remained limited to one specific album, which I've deleted and manually rebuilt (with export/copy/paste/import in CSV).
    Then I've upgraded zenphoto version by version... and now everything seems ok.

    Finally, I think my SQL dump (and ZP dump also) was not as clean as I thought. No datas missing, but the structure was messy (the columns didn't match with that zenphoto waited in import process).

    Thanks for your assistance. :-)
  • acrylian Administrator, Developer
    Glad you managed it somehow, was really running out of ideas. If you should get into trouble again please let us know!
Sign In or Register to comment.