Upgrading Gallery2
Posted in Hacks, Open Source, PHP by sandaruwan on March 18th, 2007Today, I wanted to install Ajaxian theme for my photo gallery. So, I just download it to my gallery2 themes folder, extracted the contents, the tried to install. But my gallery 2 version is way too old for the theme, so that I had to upgrade the gallery 2 itself.
The first step was to overwrite the old files with new ones. Then, I started the installation process. It went smoothly, and then they have asked to dump the mysql database and make a backup. But, as usual without doing anything, I continued. OMG.. There is an error. I got shocked. Fortunately, they have a nice debugging output. The error was regarding a mysql table. So, I opened the database manually, it was there. Oh!! The table names are case sensitive (only in Linux). I have set the mysql to only use the lowercase names, so it saves everything in lowercase, but when gallery2 tries to access them, it also uses upper case. So, the answer was simple, I went through the code. It was using adodb, found the Execute function, use the strtolower() function to convert all the sql commands to lowercase and it worked perfectly. After all my albums are there.
After upgrading, I changed the theme and uploaded some more photos. Then, I wanted to delete an unwanted album; So, I deleted that.. after the next refresh I realized I have mistakenly deleted all the albums
