Updating or upgrading a coppermine gallery

Created by webmaster

- Coppermine photo gallery upgrade - Coppermine theme gintonic and twentyten - Coppermine config.inc.php permissions It turned out to be a long story.

Why Coppermine Gallery?

It's a superb photo gallery

Before switching to Drupal I had several Coppermine albums. My son' site is the one that I did not switch - the album is the main feature of the site. Other sites that I switched to Drupal still don't have any album, even if they should. Such is as it goes. My Coppermine version 1.5.16 is outdated. I'm several security releases behind, It needs version 1.5.20. Not good (for any system). After all was said and done, I was too late. The site was shut down by the hosting service a few hours after the upgrade. Apparently the exploit files resided in the original config.inc.php files and either at the same time or later in an old fourth-party captcha program which I had left there without using it. All of this did cost me quite a few hours. Needless to say I performed a complete local virus check my own computer and internal network is clean (knock on wood). I totally forgot how I upgraded the last time so I start over again and document.

Documentation

http://documentation.coppermine-gallery.net/en/upgrading.htm Main points, each point has expanding details on the original instruction page:

  • Make a backup (dump) of your database
  • Backup your include/config.inc.php file, your anycontent.php file and your "albums" directory as a safety precaution if anything should go wrong
  • Download the most recent stable version existing in the download section of the official Coppermine homepage
  • Unpack the coppermine package you downloaded
  • Except for the "albums" directory, upload all of the new files and directories, making sure not to overwrite your anycontent.php file or the albums directory
  • Run the update script

Caveat: safeguard customisations

What these instructions do not mention is to make sure that you must safeguard any customisations, which are all in the code base. In my case, theme, image watermark and custom footer. Following original instructions, they would probably still be there but my drupalish coppermine-novice approach deleted all of that. After the upgrade it took time to identity, find/remake and re-upload the previous customisations. This ends the new instructions on how to upgrade Coppermine properly. Below my drupal-oriented upgrade, which did not go too well.

Download

Some confusion about the latest download from sourceforge. Coppermine forum items point to a page there but the latest version is not found on it. But it is right on the front page of the coppermine gallery site, with big download button on the left: http://coppermine-gallery.net

Coppermine upgrade Drupal-way is problematic

The upgrading documentation says to overwrite the old code with the new one. That should leave custom non-standard cpg files intact. I had not realised this sufficiently and went ahead the drupal way, with slight modification: Create a new gallery directory, upload and unpack the new version there. Take it out of its version directory. Then

  • delete the new version empty album directory and copy (or move) the old album directory into its place
  • delete the include/config.inc.php file and copy (or move) the old one into its place
  • delete the anycontent.php, and copy or move the old one into its place

This has worked, but all my customisations are gone, no theme and no watermarks. Looking for them in the backup. Today is a less lucky day. Both backups are faulty. This never happened before; it might be the site ran out of space (large backups). As I found out later there was an exploit in the code, and this may have also contributed to backup compression failing (I don't know). So I ended up with a Vanilla site. "I scream, you scream, we all scream for ice-cream" (the original original).

Virus exploit

A few hours later the hosting service saw an exploit on the site and shut it down. It took another day to fix it. I must say I do commend my hosting service. They were on the ball and were helpful about it. 

Theme

Themes locations: http://sourceforge.net/projects/coppermine/files/Themes/1.5.x Demo's: http://coppermine-gallery.net/demo/cpg15x drop the drop-down box Also not immediately easy to find. Found my earlier theme: twentyten. Then changed it to gintonic. Careful: for twentyten the extraction causes a double directory structure: tentyten/twentyten. That doesn't work, you need to take the files out of the second directory. The theme will not work that way, and it took me a while until I noticed this. The theme will show two pages after. Plus you may need to delete site cookies (which will log you out) - or check with a different browser. Theme image: Luckily I found the personalised header image quite quickly in my files. Uploaded to themes/twentyten/images/headers. There's actually just one header possible. I changed my mind and went for theme gintonic. Here the intermediate image will get stuck if you use a watermark. The fix is to disable the "loader animation" the little circle that keeps on turning, in the css file. Under .image, comment out the appropriate line like so: /* background:url(images/loader.gif) no-repeat center; */ 

Watermark

I found the original watermark file in my system without much searching. Then it is a simple question of uploading the file to image folder and setting its location in config > image watermarking. That was quick and easy. Much easier and successful than Drupal! Let's forget about the custom footer for now. 

File permissions

http://forum.coppermine-gallery.net/index.php?topic=30697.0 http://documentation.coppermine-gallery.net/en/configuration.htm#admin_picture_thumbnail On my hosting service it appears I can set the permissions of the config.inc.php file at 440. I'm still testing this. Obviously this took me more than just a few hours - especially having things going wrong and finding out why and how to fix it. I hope this helps as a short-cut.