can 1.4.2 and 1.4.8 run on the same database? can 1.4.2 and 1.4.8 run on the same database?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

can 1.4.2 and 1.4.8 run on the same database?

Started by JuanCordova, June 28, 2006, 04:11:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JuanCordova

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...
"What you are now reading, I am now writing." -Douglas Hofstaedter

Tranz

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.

JuanCordova

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?
"What you are now reading, I am now writing." -Douglas Hofstaedter

Tranz

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.

JuanCordova

#4
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.
"What you are now reading, I am now writing." -Douglas Hofstaedter

Tranz

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...

JuanCordova

#6
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
    $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]
"What you are now reading, I am now writing." -Douglas Hofstaedter

JuanCordova

#7
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!
"What you are now reading, I am now writing." -Douglas Hofstaedter