forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Meghan3 on March 18, 2021, 08:45:49 pm

Title: Restoring my Gallery
Post 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

Quote
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.
Title: Re: Restoring my Gallery
Post by: phill104 on March 18, 2021, 08:58:16 pm
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
Title: Re: Restoring my Gallery
Post by: Meghan3 on March 18, 2021, 09:12:00 pm
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.
Title: Re: Restoring my Gallery
Post by: phill104 on March 18, 2021, 10:42:24 pm
Oops, my bad. Yes I did mean config.inc.php

What version PHP is your new server running. Is it running MySQL or mysqli

Title: Re: Restoring my Gallery
Post by: Meghan3 on March 18, 2021, 11:01:17 pm
It looks like it might be running mysqli. The PHP version is 7.3.
Title: Re: Restoring my Gallery
Post by: phill104 on March 19, 2021, 03:01:17 pm
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
Title: Re: Restoring my Gallery
Post by: Meghan3 on March 19, 2021, 03:35:41 pm
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.

Title: Re: Restoring my Gallery
Post by: ron4mac on March 19, 2021, 07:27:30 pm
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.

Code: [Select]
// 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_';
Title: Re: Restoring my Gallery
Post by: Meghan3 on March 19, 2021, 07:42:55 pm
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.

Code: [Select]
// 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.
Title: Re: Restoring my Gallery
Post by: ron4mac on March 19, 2021, 11:37:33 pm
If you can PM me with credentials for your site, I will help you clear up the issue(s).
Title: Re: Restoring my Gallery
Post by: Meghan3 on March 19, 2021, 11:50:57 pm
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.
Title: Re: Restoring my Gallery
Post by: ron4mac on March 20, 2021, 12:40:44 am
I've been there a hundred times. There were typos in your config.inc.php that you just weren't seeing.
Title: Re: Restoring my Gallery
Post by: Meghan3 on March 22, 2021, 02:43:39 pm
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?
Title: Re: Restoring my Gallery
Post by: ron4mac on March 22, 2021, 05:58:35 pm
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.
Title: Re: Restoring my Gallery
Post by: Meghan3 on March 22, 2021, 06:24:14 pm
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.

Title: Re: Restoring my Gallery
Post by: Meghan3 on March 22, 2021, 06:43:14 pm
Not sure what I did, but I finally got the theme to change. Not going to touch it now.