Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: can 1.4.2 and 1.4.8 run on the same database?  (Read 4552 times)

0 Members and 1 Guest are viewing this topic.

JuanCordova

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
can 1.4.2 and 1.4.8 run on the same database?
« on: June 28, 2006, 04:11:10 am »

I'll start by admitting that I'm an impatient, somewhat careless, trial-and-error hacker.  For example, I did not first copy/back-up  the 'Classic' theme before hacking at it to get my site looking the way I wanted.  As such, and wanting to comply with the 'mandatory' upgrade to 1.4.8, I'm worried that my changes to 1.4.2 files may cause problems or at least, that my gallery will look really funky or crash while I try to reproduce my own poorly (or un-) documented 1.4.2 changes in 1.4.8 which may take me a few days.

So...   my questions are:

Can I do the upgrade by copying all the 1.4.8 files to a new directory, then copy over include/config.inc.php, anycontent.php and my "albums" directory from the old 1.4.2 install?  And will 1.4.2 still work after the changes the upgrade makes to the database?

My gallery is at http://garudamexico.org/galerias or you can see it embedded in my site by going to:
http://garudamexico.org and navigating to the gallery via the [Galerķa] option in the main menu in the left hand column.

Many thanks in advance...
« Last Edit: July 02, 2006, 11:00:32 am by TranzNDance »
Logged
"What you are now reading, I am now writing." -Douglas Hofstaedter

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: can 1.4.2 and 1.4.8 run on the same database?
« Reply #1 on: June 28, 2006, 04:25:32 am »

Themes in the 1.4 series should all work within the series, so you shouldn't worry about that aspect. I would recommend that you call your theme something else other than classic, and update template.html with the new path of the theme. That way, you don't have to worry about upgrades overwriting your classic theme folder.

Two versions can exist in the same database. They just need different table prefixes, which the installer does by including the version number in the prefix. But I think you'd be making more trouble than necessary going this route.

If you've modified files outside the theme folder, then it would be a bit trickier. You can use a diff application that will show you the differences between the unmodded and your versions.

Make sure to do backups of files and databases before major changes, like upgrades.
Logged

JuanCordova

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: can 1.4.2 and 1.4.8 run on the same database?
« Reply #2 on: June 28, 2006, 04:51:36 am »

Yep, I had planned to copy over the 'Classic' theme with a new name. 

So...  just so I know enough to make a decision, what would I have to do to make the two versions run out of the same database?  Would I have to mod every database call in one of the installs?

If that's so then it would seem a lot easier to create a whole new database, back up the old one, restore that back-up in the new database (as if I were moving to a new server) then change the table prefixes?  Is this something I can do in phpMyAdmin?
Logged
"What you are now reading, I am now writing." -Douglas Hofstaedter

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: can 1.4.2 and 1.4.8 run on the same database?
« Reply #3 on: June 28, 2006, 05:03:48 am »

No, you don't have to go through all that trouble. Each installation keeps the database info in include/config.inc.php. The table prefix is a variable in the code, and gets the variable from that file. So you don't have to change the code. You don't really need to do anything, the installer will suggest the prefix for you even.
Logged

JuanCordova

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: can 1.4.2 and 1.4.8 run on the same database?
« Reply #4 on: June 28, 2006, 05:18:57 am »

So let me see if I understand you...

I just run upgrade.php update.php from the new directory and the script will suggest the prefix based on the existing database?

That would be great!!

BTW,  while I waited for you to answer I went and looked at your photos.  Nice Pics!

EDIT: changed non-existent filenae "upgrade.php" to the correct one "update.php" italics above.
« Last Edit: July 02, 2006, 08:11:26 pm by JuanCordova »
Logged
"What you are now reading, I am now writing." -Douglas Hofstaedter

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: can 1.4.2 and 1.4.8 run on the same database?
« Reply #5 on: June 28, 2006, 05:29:44 am »

If you are doing a separate installation, you don't use upgrade.php, you need to follow the instructions on installation. The installation process will ask questions about the gallery, database settings, and then create the tables for you in the db. Basically you would do the same thing you did for your first gallery, except in a different folder. Pretend your current gallery doesn't exist.

OK, maybe I'm getting confused here. You want 2 copies of the gallery? Not one totally different gallery?

OK, then you would duplicate the first gallery's files and database tables. You will need to edit the table prefix in the text file that the database generates for the tables, then import that file.

This is getting more complicated than it has to be. You can backup your files and database tables and do the upgrade, which will replace the files and database tables. If you decide you don't like the change, you can replace the files, delete the cpg tables in the database, and import the tables from the backup, having made sure the backup itself was intact beforehand. If you decide you like the change, you can move on with your life instead of having to address the issue of 2 galleries...
Logged

JuanCordova

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: can 1.4.2 and 1.4.8 run on the same database?
« Reply #6 on: June 28, 2006, 05:43:59 am »

I was actually thinking of two whole seperate galleries (with identical pictures)  but only while I tweak 1.4.8 so that it looks the way I want it to, then just change the link to point to the new one and... Presto! new, more secure, identical looking gallery and happy client and users!  But it sounds like I could do that with one database by just changing
Code: [Select]
    $CONFIG['TABLE_PREFIX'] = 'cpg_'        ;
in config.inc.php in the old install to match whatever the upgrade changes it to.

Would you agree?

[EDIT]   OK, this is off topic so...
P.S.  Can I ask your opinion of LunarPages Hosting?
[/EDIT]
« Last Edit: July 02, 2006, 03:47:58 am by JuanCordova »
Logged
"What you are now reading, I am now writing." -Douglas Hofstaedter

JuanCordova

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 7
Re: can 1.4.2 and 1.4.8 run on the same database?
« Reply #7 on: July 02, 2006, 04:06:10 am »

OK, here's what I did.
1. Installed 1.4.8 in a new dir, specifying the same database table prefix as my old 1.4.2 install ( cpg_ ), but with a different database name, user, etc.
2. copied include/config.inc.php, anycontent.php and my "albums" directory from my old install over their couterparts in the new install.
3. copied the themes/classic directory from my old install to themes/MyTheme in the new one.
4. deleted the new database using phpMyAdmin.

   Both versions worked beautifully, with the same albums and pictures, out of the same database.

5. deleted my old install and changed all links to point to the new one.

You were right, TranzNDance, that all my theme changes worked fine in 1.4.8.

Lesson learned?  Yes.  Coppermine is great software with a great template system.  I need not have worried about the upgrade messing things up at all!  Nextime I'll do it by the book instructions.

-THANKS!
« Last Edit: July 02, 2006, 04:35:51 am by JuanCordova »
Logged
"What you are now reading, I am now writing." -Douglas Hofstaedter
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 21 queries.