[Closed]: Upgrade results in "fatal error:" message, unchanged db tables [Closed]: Upgrade results in "fatal error:" message, unchanged db tables
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[Closed]: Upgrade results in "fatal error:" message, unchanged db tables

Started by rpkemp, June 06, 2010, 06:12:33 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

rpkemp

Hi. I set up a gallery a week or so ago using version 1.4.27. I decided to try and upgrade to 1.5.6 this morning.

I downloaded the latest zip package to my server and followed the instructions here:

http://documentation.coppermine-gallery.net/en/upgrading.htm

i.e., copied all files & directories from the unzipped cpg15x/ directory into the root directory of my gallery. I retained the existing anycontent.php file. I disabled the one plugin I had installed.

I then ran update.php, and seemed to receive a healthy report - the only unresolved issues reported were those various files that the script had been unable to delete.

However, trying to load the versioncheck.php file or go to the gallery home page resulted in a terse message that just read:

fatal error:

with no further explanation.

I was able to restore the gallery to normal operation just by restoring a backed up version of the root directory. If I understand things correctly, this should not be possible because the update.php script should have renamed my database tables. I checked, and the tables had not been renamed.

The gallery, running in its unupdated state, is here:

http://copwick.net/gallery

Thanks in advance.

Rob

phill104

Obviously something went wrong. Did you see the new update page or was it the old style one? If you have just restored then I doubt it could be the new script that ran.

As you have a backup already I suggest you try the following (make sure you have a backup of your database and files and that the backup is good first.)

Delete all the coppermine files except for your albums folder, include/config.inc.php and your anycontent.php

Upload the 1.5.6 files

Run update.php
It is a mistake to think you can solve any major problems just with potatoes.

rpkemp

Quote from: Phill Luckhurst on June 06, 2010, 08:32:45 PM
Obviously something went wrong. Did you see the new update page or was it the old style one? If you have just restored then I doubt it could be the new script that ran.

Not sure - I'm attaching a pdf of the output that I got from following the procedure you suggest below. Everything looked the same both times.

Quote
As you have a backup already I suggest you try the following (make sure you have a backup of your database and files and that the backup is good first.)

Delete all the coppermine files except for your albums folder, include/config.inc.php and your anycontent.php

Upload the 1.5.6 files

Run update.php

Yes, did all that, and I still get the same result. I'm still able to revert to the previous state by just renaming the gallery and backup directories to what they were before, so there are still no changes being made to the database, presumably.

I should imagine the most likely explanation is some authentication failure in addressing the database - but shouldn't that produce some kind of more verbose error message?

Joachim Müller

The output on the attachment you posted comes from the update file that used to come with cpg1.4.x. It definitely is not from cpg1.5.x and therefore won't do what it is supposed to do. Once again: get cpg1.5.6, upgrade as suggested in the docs (replacing ALL files on your server with the ones from the package except anycontent). Make sure that your FTP app is set up to replace existing files.

rpkemp

Quote from: Joachim Müller on June 07, 2010, 08:37:56 AM
The output on the attachment you posted comes from the update file that used to come with cpg1.4.x. It definitely is not from cpg1.5.x and therefore won't do what it is supposed to do. Once again: get cpg1.5.6, upgrade as suggested in the docs (replacing ALL files on your server with the ones from the package except anycontent). Make sure that your FTP app is set up to replace existing files.

I did that. The files and directories in the gallery root directory were undoubtedly the files extracted from the cpg1.5.6.zip file. However, following the suggestion made by Phill Luckhurst I copied over include/config.inc.php from my existing gallery. This file includes the line

$CONFIG['TABLE_PREFIX'] =                'cpg14x_';

which may have something to do with the issue?

So I repeated the exercise without copying over config.inc.php. The update script then fails stating that Coppermine is not installed properly and redirects to the installation page. This can't be right ... ?

Αndré

Quote from: rpkemp on June 07, 2010, 02:36:57 PM
I copied over include/config.inc.php from my existing gallery. This file includes the line

$CONFIG['TABLE_PREFIX'] =                'cpg14x_';

which may have something to do with the issue?
No. That's just a string. You can also choose 'ChuckNorris2.0_' as table prefix.


Quote from: rpkemp on June 07, 2010, 02:36:57 PM
So I repeated the exercise without copying over config.inc.php. The update script then fails stating that Coppermine is not installed properly and redirects to the installation page. This can't be right ... ?
This is intended, as Coppermine always runs the installer if there is no config.inc.php (that's the way Coppermine determines if it's already installed or not).

rpkemp

Quote from: Αndré on June 07, 2010, 03:01:29 PM
No. That's just a string. You can also choose 'ChuckNorris2.0_' as table prefix.

OK, good idea, I'll do that. ;-)

This is intended, as Coppermine always runs the installer if there is no config.inc.php (that's the way Coppermine determines if it's already installed or not).

Right. Thanks. I'll proceed on that basis and see what happens.

phill104

Quote from: rpkemp on June 07, 2010, 02:36:57 PM
However, following the suggestion made by Phill Luckhurst I copied over include/config.inc.php from my existing gallery. This file includes the line

Eh, where did I tell you to overwrite that file? In fact my suggestion tells you not to overwrite that file.

What I was telling you to do is delete everything except your albums folder, the anycontent.php file and include/config.inc.php

So your /gallery folder will only contain

albums (the folder filled with all your images)
include (the only file in there will be your config.inc.php)
anycontent.php

And that is is. Once you have verified that is the state of your /gallery folder in your ftp app (please use a decent one such as Filezilla and not some crap like frontpage or dreamweaver) then extract and upload all the files from the Coppermine 1.5.6 download. Examine them and make sure the headers show the correct version of the files. Once you've done that then run update.php. If you have the correct files in place it will request your admin password before you can continue. The 1.4.x version of update.php does not include that check.

As you seem to be struggling maybe you should run this on a test setup on your local machine to save you all the uploading stuff so you can get it right and know how to do it before you commence on a live site. Wamp (google it) is a great tool for that.
It is a mistake to think you can solve any major problems just with potatoes.

rpkemp

Quote from: Phill Luckhurst on June 06, 2010, 08:32:45 PM

Delete all the coppermine files except for your albums folder, include/config.inc.php and your anycontent.php


Ambiguous, perhaps? Admittedly the upgrade instructions tell you to make a backup of your include/config.inc.php file and if I'd referred back to the upgrade instructions I would have understood what you were saying.

rpkemp

OK, installation worked but failed to transfer my 1.4 galleries to the 1.5 database tables.

Never mind, I'll figure it out, I expect.

phill104

It doesn't transfer them, just adds a few required bits. It still appears you have 1.4.27 installed in your space so I am not sure what you are doing.
It is a mistake to think you can solve any major problems just with potatoes.

rpkemp

Quote from: Phill Luckhurst on June 07, 2010, 08:18:20 PM
It still appears you have 1.4.27 installed in your space so I am not sure what you are doing.

Well I fell back to 1.4.27 while pondering my next move. OK, I've restored the 1.5 version for now, but it's looking empty.

phill104

You need to check that the include/config.inc.php is pointing to the correct database. It is obviously not as you have no images
It is a mistake to think you can solve any major problems just with potatoes.

rpkemp

Quote from: Phill Luckhurst on June 07, 2010, 09:09:52 PM
You need to check that the include/config.inc.php is pointing to the correct database. It is obviously not as you have no images
<?php

Well the two config.inc.php files - the new, non-working one and the old, working one - are nearly identical - see below

NEW include/config.inc.php FILE:


<?php
// Coppermine configuration file
// Silly safe mode
define('SILLY_SAFE_MODE'1);


// MySQL configuration
$CONFIG['dbserver'] =                         'localhost';        // Your database server
$CONFIG['dbuser'] =                         'rob';        // Your mysql username
$CONFIG['dbpass'] =                         '********';                // Your mysql password
$CONFIG['dbname'] =                         'gallery1_db';        // Your mysql database name


// MySQL TABLE NAMES PREFIX
$CONFIG['TABLE_PREFIX'] =                'cpg14x_';
?>





OLD include/config.inc.php FILE:



<?php
// Coppermine configuration file
// MySQL configuration
$CONFIG['dbserver'] =                         'localhost';        // Your database server
$CONFIG['dbuser'] =                         'rob';        // Your mysql username
$CONFIG['dbpass'] =                         '********';                // Your mysql password
$CONFIG['dbname'] =                         'gallery1_db';        // Your mysql database name


// MySQL TABLE NAMES PREFIX
$CONFIG['TABLE_PREFIX'] =                'cpg15x_';
?>



rpkemp

Sorry, I got "new" and "old" mixed up. But you get the picture.

Αndré

Dude, what the hell are you doing? Please try to understand how that config file works.

Joe Carver

rpkemp, If you have paid for your hosting then you probably have tools available
to help yourself. Like cPanel and even more so...phpMyAdmin.

Your cpg 1.5.6 is obviously happy and reading a database on your server. It is running.

Then the question to be answered is "is there anything in that db?" (pictures - albums - users, etc.) Use phpMyAdmin to find that out. Use your db management tools to see if there are other db's in/on your account. Use your Filezilla or Filemanger to see if there are any files/folders in your albums directory.

Take a step back, take a breather and you will be fine.

rpkemp

Quote from: Αndré on June 07, 2010, 09:40:06 PM
Dude, what the hell are you doing? Please try to understand how that config file works.

?

phill104

What he is tryin to say is that the old gallery has one prefix and you seem to have changed that prefix for the new one. As such the new instal is looking at a different databs so there is no way it will see the images and data from the old.
It is a mistake to think you can solve any major problems just with potatoes.

rpkemp

Quote from: Joe Carver on June 07, 2010, 09:51:31 PM
rpkemp, If you have paid for your hosting then you probably have tools available
to help yourself. Like cPanel and even more so...phpMyAdmin.

Your cpg 1.5.6 is obviously happy and reading a database on your server. It is running.

Then the question to be answered is "is there anything in that db?" (pictures - albums - users, etc.) Use phpMyAdmin to find that out. Use your db management tools to see if there are other db's in/on your account. Use your Filezilla or Filemanger to see if there are any files/folders in your albums directory.

Take a step back, take a breather and you will be fine.

No offence to anyone, but there seem to be two contradictory views about the typical end user among contributors to this forum:

1. He is a simple minded person who is incapable of finding his way around a mysql table (this is a pretty reasonable view and probably the most helpful approach)
2. He is someone who wants to, and is capable of, understanding 'how that config file works'.

André, I don't think I need to understand how the config file works any better than I do already. All the important data are identical in the two files I quoted above. I'm clear about that. They should both work. The fact that one doesn't can't be a result of my not understanding how the config file works.

Joe, yes there's data in the database:

mysql> SELECT title FROM cpg14x_albums;
+-------------------------------+
| title                         |
+-------------------------------+
| Pictures from old photo album |
| Kemp family - 1960s-70s       |
| Photos from Gerry             |
+-------------------------------+
3 rows in set (0.00 sec)


Phill, you're right that the data is in tables with the 1.4 prefix. But that was what I was trying to say when I said that the installation process had not transferred my data from the 1.4 database tables to the 1.5 ones - to  which you replied that it wasn't supposed to.

I can see I do need to understand this whole thing more clearly. I have followed the instructions (correctly, I think, in the end) and it hasn't worked out. There must be a reason. The thing is I have almost lost the will to live.

I really appreciate the time you've spent trying to help me sort this out but please don't waste any more time on it. Thanks.