forum.coppermine-gallery.net

Support => cpg1.6.x Support => cpg1.6 upgrading => Topic started by: Michael O on February 07, 2022, 01:25:21 pm

Title: Moving servers. Upgraded 1.4 -> 1.5 - 1.6 Working old server, errors on new
Post by: Michael O on February 07, 2022, 01:25:21 pm
Hi,
Am moving a customer's site that includes a Coppermine Gallery,  to a new server/host. 
Was running on 1.4x, but new Server/Host has minimum of PHP 7.3 and up to PHP 8.

Lastnight I stayed up til early hours working through the two step upgrade from 1.4 to 1.5, then to latest ver of 1.6.  Did this on old server to ensure I got it working and so could do the upgrade with PHP 5.x before importing the DB tables and Coppermine folder to new server which is running PHP 7.3.

It is working fine after the upgrade on original server -  http://choppersaustralia.com/Chopper-Galleries/coppermine/

But once the Siteground Techs did the import of database and the Coppermine folder (from above working installation), it now gets the following error...


Code: [Select]
Fatal error: Uncaught Error: Call to undefined function ereg() in /{full link}/Chopper-Galleries/coppermine/include/debugger.inc.php:126 Stack trace: #0 /{full link}/Chopper-Galleries/coppermine/include/init.inc.php(26): require_once() #1 /{full link}/Chopper-Galleries/coppermine/index.php(68): require('/home/customer/...') #2 {main} thrown in /{full link}/Chopper-Galleries/coppermine/include/debugger.inc.php on line 126

Seems to have some issue with the debugger.inc.php file.  As a test I did try renaming the file extension from .php to something else on the debugger.inc.php in case that would bypass the error occurring, but same error remains.

Any suggestions on what to do?  I have tried searching and reading though a bunch of posts here on the forums, but can't work out what the solution is or what has caused it (other than I assume a difference from PHP 5.x to 7.3).

Process I performed to update from 1.4x to 1.6x was...
1. Backup Albums and the two PHP files.
2. Turn off plugins.
3. Delete all old files except album and the two PHP files.
4. Paste in latest CPG 1.5x files and folder structure.
5. Run upgrade.php
6. Run Update Database from admin.
7. Check files from in admin.
8. Added a couple new ver files into the albums folders based on Check File report.

Stage 2 - update to 1.6x
1. Backup Albums and the two PHP files.
2. Turn off plugins.
3. Delete all old files except album and the two PHP files.
4. Paste in latest CPG 1.5x files and folder structure.
5. Run upgrade.php - had issues not connecting to DB and changing from MYSQL to MYSQLI.  Eventually found editing to the new ver 1.6x "config.inc.php" file to have same DB, User, PW and prefix as old ver 1.5x file had. This enabled the upgrade.php file to function. 
7. Check files from in admin and ensure all up to date and present.
Coppermine all working as ver 1.6 on old server [ http://choppersaustralia.com/Chopper-Galleries/coppermine/ ] on PHP 5.5.38.

Assumed that once tables imported to new DB and files/folders moved over it should work on new server (running PHP 7.3), but not so lucky.


Thanks for any help you can offer.  Has been about a 3 day process so far and have the site's forums offline while making the transition to go live on new server - so would be great to work out how to get it fixed.

Michael O.
P.S. Thanks to the devs for Coppermine.  Has been a very good gallery system over the years.
Title: Re: Moving servers. Upgraded 1.4 -> 1.5 - 1.6 Working old server, errors on new
Post by: ron4mac on February 07, 2022, 05:38:34 pm
The Siteground techs didn't do a very good job.  There is no such function call in all of CPG 1.6.16,  let alone in include/debugger.inc.php.
I don't believe the issue stems from any PHP version (unless a server misconfiguration). My development version is on a Siteground account and I've had no issue with any PHP 7 or 8 version.
Maybe there was some corruption in what they imported.

You could try using the installer stub (https://forum.coppermine-gallery.net/index.php/topic,79168.msg383813.html#msg383813) to load all the correct files.
Title: Re: Moving servers. Upgraded 1.4 -> 1.5 - 1.6 Working old server, errors on new
Post by: Michael O on February 07, 2022, 10:38:02 pm
Thanks Ron,
I will relay this to the Siteground techs and see what they can sort out.

Will let you know how we go.  Hopefully can get it sorted ASAP.  :)
Thanks
Michael Offe.
Title: Re: Moving servers. Upgraded 1.4 -> 1.5 - 1.6 Working old server, errors on new
Post by: Michael O on June 19, 2022, 12:20:36 pm
Hi Ron,
Have finally come back to getting this site migration finished (had a family crisis in between).

We have the Coppermine database correctly replicated on the new SiteGround Server now (there were some tables missing in last attempt). 

Current 1.6.16 files from old server also moved over.

But when you go to following link (new server) we still get this error...
http://www.choppersaustralia.com/Chopper-Galleries/coppermine/
----------------
Fatal error: Uncaught Error: Call to undefined function ereg() in /home/customer/www/choppersaustralia.com/public_html/Chopper-Galleries/coppermine/include/debugger.inc.php:126 Stack trace: #0 /home/customer/www/choppersaustralia.com/public_html/Chopper-Galleries/coppermine/include/init.inc.php(26): require_once() #1 /home/customer/www/choppersaustralia.com/public_html/Chopper-Galleries/coppermine/index.php(68): require('/home/customer/...') #2 {main} thrown in /home/customer/www/choppersaustralia.com/public_html/Chopper-Galleries/coppermine/include/debugger.inc.php on line 126
----------------

BUT...   If we go to the index page specifically, we don't get the error and it works fine...
http://www.choppersaustralia.com/Chopper-Galleries/coppermine/index.php

So the only difference is in entering the index.php into the browser. 
We checked that it was correctly set for index.php to be a default page and it is.
Have checked a few other ideas and can't work out what is causing this.

Just thought I would ask in case you had seen this before or had any thoughts.  I will also ask SiteGround if they can look at it as well.

Thanks
Michael.
Title: Re: Moving servers. Upgraded 1.4 -> 1.5 - 1.6 Working old server, errors on new
Post by: phill104 on June 19, 2022, 10:01:08 pm
As per above, try the installer stub. I is quite simple to use and hopefully will fix your issue. It certainly sounds like not all files were upgraded correctly.