mysqli related error when restoring from backup

In the process of moving my zenphoto install from one VPS VM to another.

Ran the backup on the old host, and have got to the point of running setup on the new host.

When I select my backup and attempt to restore, I get this error :
Fatal error: MySQLi Error: ( SHOW INDEX FROM `[DB]`[prefix][prefix]admin_to_object ) failed. MySQLi returned the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.admin_to_object' at line 1 in /var/www/zenphoto/zp-core/functions-db-MySQLi.php on line 78

both old and new zenphoto is version 1.4.5.5

These are my mysql rpm version :
# rpm -qa | grep mysql
mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
mysql-libs-5.5.35-1.el6.remi.x86_64
php-mysql-5.4.24-1.el6.remi.x86_64
mysql-devel-5.5.35-1.el6.remi.x86_64
compat-mysql51-5.1.54-1.el6.remi.x86_64
mysql-5.5.35-1.el6.remi.x86_64
mysql-server-5.5.35-1.el6.remi.x86_64
Alas, I don't now have the original host to check what versions were on there before.

I'm really just posting this as a long-shot to see if anyone has seen this problem before, and/or can put their finger on the fix. I couldn't find anything from searching..hence the long-shot.

Comments

  • There was a a bug in handling database prefixes which were simple underscores. So probably you should change your prefix. Otherwise use the 1.4.5.9 release for the new install.
  • Thanks for your reply.

    Looking at the tables in my new DB, and if I understand correctly, I don't see any prefix with underscores

    +--------------------+
    | Tables_in_zenphoto |
    +--------------------+
    | .admin_to_object |
    | .administrators |
    | .albums |
    | .captcha |
    | .comments |
    | .images |
    | .menu |
    | .news |
    | .news2cat |
    | .news_categories |
    | .obj_to_tag |
    | .options |
    | .pages |
    | .plugin_storage |
    | .search_cache |
    | .tags |
    +--------------------+

    Where you mention 'change your prefix', are you referring to something elsewhere ?

    Regarding your second point, and restoring my backup from a 1.4.5.5 version to a 1.4.5.9 version.

    Do I simply put 1.4.5.9 in place on my new host, and copy something from my 1.4.5.5 version zenphoto directory ( saved from the old host ) into the new 1.4.5.9 zenphoto directory, and then run setup, so I see the "restore from backup" option ?

    If so, could you please point out what I have to copy from the old to the new ?
  • acrylian Administrator, Developer
    BY default Zenphoto uses a database prefix `zp_`. But it is not required.

    Actually all is written here how to upgrade:
    http://www.zenphoto.org/news/installation-and-upgrading
    As you hopefully noted there is a folder /backup which contains the Zenphoto backup (of course only if you used our database backup plugin).
  • The DB prefix is defined in your zenphoto configuration file. The actual default of this will depend upon the folder where zenphoto is installed. If it is installed in the root the it may default to a simple underscore.
  • saigo Member
    Thanks for replies - just finally got around to playing with this again.

    copied the backup file and albums directory from the old zenphoto directory into latest version directory.

    In zenphoto.cfg.php file, I changed

    $conf['mysql_prefix'] = ".";

    to

    $conf['mysql_prefix'] = "zp";

    Re-ran setup, and restored from backup.. all worked like a charm.
Sign In or Register to comment.