forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Meghan3 on March 18, 2021, 08:45:49 pm
-
I recently switch servers for my sites and I'm trying to restore my gallery. I had done it once before but seems there is something I am missing. I downloaded all my files and the SQL from the PHPAdmin from the old server. Now after I have reuploaded my files and the SQL to the new server it's giving me this
Coppermine critical error:
Unable to connect to database !
MySQLi said: :
I clearly can see I have done something wrong, but I am not sure what it is. I am looking for some help to figure out what I have done wrong and how to restore my gallery. The last thing I want to do redo the albums and reupload all the files.
-
What that usually suggests is you need to edit your include/include.inc.php file to reflect your new database connection details. Once done, you also need to run /update.php
-
Do you mean the config.inc.php file? I did change that to the database on the new server, but when I run the update.php it didn't do anything.
-
Oops, my bad. Yes I did mean config.inc.php
What version PHP is your new server running. Is it running MySQL or mysqli
-
It looks like it might be running mysqli. The PHP version is 7.3.
-
Then you will need to upgrade to 1.6.x and that version of PHP is not supported by CPG1.5.x
https://forum.coppermine-gallery.net/index.php/topic,79013.0.html
-
The gallery was upgraded before I downloaded the SQL for the transfer. I have tried this with files from CPG1.6x and it's still giving me the error. I even tried at one point deleting the config file and installing it as if it was all new. It let me install the gallery. I just tried doing what was said in the thread you sent me and I'm still getting the same error.
What I am trying to do is just restore all the albums and files that were within my old gallery. I know that involves downloading the SQL and I did that. I added all the files back into the gallery and didn't install a new gallery. I did that on another site and it didn't work either. This one I uploaded everything as is and then through the phpadmin uploaded the SQL from my other gallery. That is when I go that error. Then I tried all the things I listed above and nothing.
All I want to do is retore all the albums and files that I had in the gallery without having to go through and do it manually. It seems I have done something wrong.
-
You can't use the include/config.inc.php file from your old server on the new one without changing the values to coincide with with the database to which you imported the SQL data.
// Coppermine configuration file
// Database configuration
$CONFIG['dbtype'] = 'mysqli'; // Your database type
$CONFIG['dbserver'] = 'localhost'; // Your database server
$CONFIG['dbuser'] = 'old-dbuser'; // Your database username <-- these must match
$CONFIG['dbpass'] = 'old-password'; // Your database password. <-- the values/names
$CONFIG['dbname'] = 'old-dbname'; // Your database name <-- set on the new host
// DATABASE TABLE NAMES PREFIX
$CONFIG['TABLE_PREFIX'] = 'cpg16x_';
-
You can't use the include/config.inc.php file from your old server on the new one without changing the values to coincide with with the database to which you imported the SQL data.
// Coppermine configuration file
// Database configuration
$CONFIG['dbtype'] = 'mysqli'; // Your database type
$CONFIG['dbserver'] = 'localhost'; // Your database server
$CONFIG['dbuser'] = 'old-dbuser'; // Your database username <-- these must match
$CONFIG['dbpass'] = 'old-password'; // Your database password. <-- the values/names
$CONFIG['dbname'] = 'old-dbname'; // Your database name <-- set on the new host
// DATABASE TABLE NAMES PREFIX
$CONFIG['TABLE_PREFIX'] = 'cpg16x_';
To make sure I am understanding what you are saying. The user name and password for the database should be the same, but the database can be new, or should it be the old one?
I have tried with the old database information and new database information and both give me the error.
-
If you can PM me with credentials for your site, I will help you clear up the issue(s).
-
If you can PM me with credentials for your site, I will help you clear up the issue(s).
Just sent you a pm with the information.
-
I've been there a hundred times. There were typos in your config.inc.php that you just weren't seeing.
-
Now that the gallery has been restored it's causing server issues and won't let me change the theme at all. Should it be doing that?
-
Your theme is set to 'zdc copp 10' but that theme folder is empty. That will cause CPG to revert to Curve.
I also set your gallery URL in the config to https://... instead of http://... to match how it is being run.
-
I tried to see if I deleted the old files from zdc copp 3 and put in the files for the new theme ( zdc copp 10 ) I wanted to see if that would work. it didn't. Even when I had the correct files in there it wouldn't let me change the theme. Didn't matter which theme I picked it would stay with the one that it's currently using which is the zdc copp 3.
-
Not sure what I did, but I finally got the theme to change. Not going to touch it now.