forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 upgrading => Topic started by: rpkemp on June 06, 2010, 06:12:33 pm

Title: [Closed]: Upgrade results in "fatal error:" message, unchanged db tables
Post by: rpkemp on June 06, 2010, 06:12:33 pm
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
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: phill104 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.

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
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: rpkemp on June 06, 2010, 09:26:53 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?
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: 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.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: rpkemp on June 07, 2010, 02:36:57 pm
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 ... ?
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: Αndré on June 07, 2010, 03:01:29 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.


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).
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: rpkemp on June 07, 2010, 03:10:11 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.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: phill104 on June 07, 2010, 06:09:15 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.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: rpkemp on June 07, 2010, 07:59:30 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.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: rpkemp on June 07, 2010, 08:13:43 pm
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.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: phill104 on June 07, 2010, 08:18:20 pm
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.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: rpkemp on June 07, 2010, 08:52:58 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.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: phill104 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
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: rpkemp on June 07, 2010, 09:24:03 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:

Code: [Select]
<?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:

Code: [Select]

<?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_';
?>


Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: rpkemp on June 07, 2010, 09:25:37 pm
Sorry, I got "new" and "old" mixed up. But you get the picture.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: Α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.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: 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.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: rpkemp on June 07, 2010, 09:53:13 pm
Dude, what the hell are you doing? Please try to understand how that config file works.

?
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: phill104 on June 07, 2010, 09:54:47 pm
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.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: rpkemp on June 07, 2010, 10:09:17 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:
Code: [Select]
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.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: phill104 on June 07, 2010, 10:13:48 pm
OK, I'll close this off.

For anyone reading this, the big mistake this user is making is expecting the data from one database to be transfererred to another. That will not happen the way the upgrade works. The user should not have fiddled with the config file but left it alone. It is a simple matter for uploading all the files and running a script. The old tables will be adjusted by that script but it will not create a new database. That is why you need to backup just incase something goes wrong. Please do not follow this thread as it is a mess and has become very messed up along the way.
Title: Re: Upgrade results in "fatal error:" message, unchanged db tables
Post by: Αndré on June 07, 2010, 10:16:16 pm
the installation process had not transferred my data from the 1.4 database tables to the 1.5 ones
I think here's your error in reasoning. When you upgrade your gallery, the table prefix is still the same.