Database restored but can't see the gallery's structure Database restored but can't see the gallery's structure
 

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

Database restored but can't see the gallery's structure

Started by penelope79, April 02, 2012, 11:39:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

penelope79

Hi, my site got hacked first and then my host accidentally deleted my whole site, which it meant a loss of 7 years of work and over 21.000 photos.
I had a backup of the gallery database (v. 1.5.18) which I successfully restored. I thought that, after restoring the database I could've still see categories, albums etc. (though empty) because I can see them all from PhpMyAdmin, however if I access the gallery from my browser that's not what's happening. The gallery works fine, I didn't get errors but I can't see its structure, it's like a gallery just installed. Hence I would like to ask you whether this is normal because there are no files and all I can do is rebuilding my gallery from scratch or if it's something I can do about it which would, at least, help me not to do everything all over again.
Thanks in advance.

Joe Carver

Ouch - don't they have an archived backup somewhere?

After you restored the db from the backup did you run update.php?

Does it show the same behavior for things other than structure, like Users, Groups and, any config settings that might have been applied?

Αndré

To restore your gallery you need a backup/dump of your MySQL database and (at least) the files and folders from the albums directory.

penelope79

@Joe Carver: Thank you, my first reaction was actually "I want to kill myself!" and no, the backup was accidentally deleted, that's why I lost everything.  :(
I ran the update.php but for each result I got the message that it was already updated.
And yes, it's the same for all the other sections of the gallery: for instance, I can see Users from PhpMyAdmin but not in the gallery itself. This is the link: http://www.gwyneth-paltrow.org/gallery/
What you see it's exactly what seems to be there.

@André: Thank you André. So I guess the behaviour is normal, because even though I have a backup of my MySQL database I no longer have the files, that's why I can't anything, am I right?

Αndré

If you have a (working) backup of your database, all settings, groups, user, comments, categories, albums and files* will be visible in your gallery. So it's not normal, that there's nothing in your gallery after you restore your database.


*) the picture files themselves are stored in the albums directory, but you'll see all references in your gallery anyway (when visiting the picture files will be replaced with a placeholder file if they don't exist).

penelope79

It's the first time that I'm forced to restore the database and since the restoring was successful, I could see all files in PhpMyAdmin and I didn't get any error, I thought the db was working as well, even though my albums directory is empty. But now I really don't know.
Is there anything I can still do to try to have it work? I also repeated again the whole procedure but with the same result. Thanks!

Αndré

Check include/config.inc.php that your gallery uses the correct database and table prefix.

penelope79

Thank you André. I checked the file: user, password and the dbname are correct.
And then there is:

$CONFIG['TABLE_PREFIX'] = 'cpg_';

Which is correct as well, right?

Αndré

I don't know if that's correct. Depends on the table names in your database.

penelope79

Thanks to your tip André I think I've probably found the issue: I didn't noticed at first but the backup restored had actually  different prefix "cpg132_" instead of the default "cpg_". However, the database have apparently both files now, those with the fresh installation I made before restoring the db (whose tables' name start with "cpg_") and those belonging to the backup (whose tables' name I found out is "cpg132_" and which I thought would've replaced the ones of the new installation).
I tried to change include/config.inc.php the prefix "cpg_" into "cpg132_" and it gives me a Fatal error not specified.
Should I try to manually delete the tables called "cpg_" leaving the backup tables and then change again include/config.inc.php prefix into "cpg132_" or it would probably mess things even more?

penelope79

I apologize for the double post but I just wanted to let you know that I solved the issue with the following steps:

1-I deleted again completely Coppermine and its database, but before I made a backup of include/config.inc.php (which was essential).
2-I created a new database for Coppermine paying attention that all data matched those in the include/config.inc.php I previously saved. 3-I restored the backup where I have modified through a text editor the prefixes in the whole file so as to make them match with the new installation I was going to do (for instance, in my case I changed "cpg132_" in "cpg_", which was the same as in include/config.inc.php).
4-I copied all Coppermine files and folders in my gallery folder through FTP and changed permission to "albums" and "includes" folders accordingly.
5-I uploaded the previously saved file config.inc.php into the "include" folder.
6-I ran update.php as a final step

Finally, the structure is back again, which at least will help me to find photos all over again *sigh*

Thank you so much André for your help