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: Database restored but can't see the gallery's structure  (Read 4254 times)

0 Members and 1 Guest are viewing this topic.

penelope79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Database restored but can't see the gallery's structure
« on: April 02, 2012, 11:39:47 pm »

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

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Database restored but can't see the gallery's structure
« Reply #1 on: April 03, 2012, 12:24:42 am »

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é

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Database restored but can't see the gallery's structure
« Reply #2 on: April 03, 2012, 10:53:09 am »

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

penelope79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: Database restored but can't see the gallery's structure
« Reply #3 on: April 03, 2012, 10:55:41 am »

@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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Database restored but can't see the gallery's structure
« Reply #4 on: April 03, 2012, 11:05:33 am »

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

penelope79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: Database restored but can't see the gallery's structure
« Reply #5 on: April 03, 2012, 03:37:36 pm »

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!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Database restored but can't see the gallery's structure
« Reply #6 on: April 03, 2012, 03:50:55 pm »

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

penelope79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: Database restored but can't see the gallery's structure
« Reply #7 on: April 03, 2012, 06:58:24 pm »

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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Database restored but can't see the gallery's structure
« Reply #8 on: April 03, 2012, 08:30:26 pm »

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

penelope79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: Database restored but can't see the gallery's structure
« Reply #9 on: April 03, 2012, 09:40:52 pm »

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?
Logged

penelope79

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: [Solved] Database restored but can't see the gallery's structure
« Reply #10 on: April 04, 2012, 12:13:56 am »

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
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.