forum.coppermine-gallery.net

Support => cpg1.6.x Support => cpg1.6 miscellaneous => Topic started by: justinbowser on January 24, 2020, 11:26:24 pm

Title: Migrating CPG 1.6 to new host
Post by: justinbowser on January 24, 2020, 11:26:24 pm
Now that I have my CPG back up and running I feel I should move it to a different host.  Would the easiest thing be to just do a fresh CPG 1.6 install on the new host and somehow pull over the content or is there a regular migration utility/process?
Title: Re: Migrating CPG 1.6 to new host
Post by: ron4mac on January 25, 2020, 01:21:03 am
Copy the CPG directory from one host to the other.
Export the database and import it on the new host.
Change the database values in include/config.inc.php as needed.
Done...
Title: Re: Migrating CPG 1.6 to new host
Post by: justinbowser on January 25, 2020, 01:26:15 am
Thanks, I'll give that a try and see what happens.  This is after I do a fresh install of CPG on the new host, right?
Title: Re: Migrating CPG 1.6 to new host
Post by: ron4mac on January 25, 2020, 02:27:12 am
This is after I do a fresh install of CPG on the new host, right?
Nope. If you just copy the entire CPG directory from the current host to the new host, all the files will be there with no need to do an install. You just need the database transferred and the config file set to point to the database.
Title: Re: Migrating CPG 1.6 to new host
Post by: phill104 on January 25, 2020, 03:28:55 pm
There are quite detailed instructions here https://documentation.coppermine-gallery.net/en/export.htm#moving
Title: Re: Migrating CPG 1.6 to new host
Post by: justinbowser on October 31, 2020, 09:43:51 pm
I know this is going to make me look like the world's worst procrastinator but I just this morning got around to trying this move.  Been up in an off-grid cabin in the mountains of SE OK since the virus started and just came back to civilization a couple of weeks ago!

Here's what I have done:

1.  I zipped up the entire Coppermine installation on the old host and extracted it on to my new host.
2.  Exported the database to a file through phpMyAdmin.
3.  Created a new mysql database on the target host.
4.  Imported the backup file into the new DB on new host.
5.  Modified the config.inc.php file with the new DB name, DB username, and password.

When I try to launch the moved Coppermine Gallery I get:

Coppermine critical error:
Unable to connect to database !

MySQLi said: :

I did notice that when I was updating the config.inc.php file that the existing password looked like it was encrypted and the password I replaced it with was in plain text.  Is there a switch I need to set somewhere to accept a plain test PW or is something else FUBAR?
Title: Re: Migrating CPG 1.6 to new host
Post by: phill104 on October 31, 2020, 10:33:19 pm
You simply need to fully check your MySQL credentials. One or more of them is incorrect. If you have access to phpmyadmin create a new user with access to only the cpg database. Then use those credentials in coppermine. Be sure to run update.PHP when you have the connection sorted.
Title: Re: Migrating CPG 1.6 to new host
Post by: justinbowser on October 31, 2020, 11:56:28 pm
Can I use MySQL Databases to create user or does it need to be done through phpMyAdmin?
Title: Re: Migrating CPG 1.6 to new host
Post by: justinbowser on November 01, 2020, 12:02:36 am
Never mind.  Thanks for the sanity check!  I must have fat-fingered something the first three times I tried but this time the planets were in alignment and all is well!
Title: Re: Migrating CPG 1.6 to new host
Post by: justinbowser on November 01, 2020, 02:00:14 am
The move looks like it was successful and everything is good to go!  Thanks, Phill, for your help.