Announcement

#1 2014-12-03 08:46:08

Analog Kid
Member
2014-12-03
6

Loss of sync between db and file structure

Hey all--

I have a question about how resilient Piwigo is to mismatched files and database state.  It boils down to this: when the database state doesn't match the file system, what can I do to force Piwigo into a safe configuration without clearing the database entirely?

Here's more detail:

Just starting to play around with Piwigo for a self hosted site.  I've used Gallery in the past, but it's now discontinued.  I look forward to learning something new.

In playing around, I installed the Piwigo files, installed a few themes, poked, prodded, then made some changes to file permissions to try and restrict write access as much as possible.  Made a change I wish I hadn't, and rather than try and back it out, I deleted the file structure and reinstalled.

When I did that, I got an error message.  The installation went fine, but viewing the site failed.  I figured I'd screwed something up further up in the chain and did a restore from backup.  No help.

Finally I did something crazy, and actually read the error messages.  Not much help because I'm not familiar with the system yet, but it couldn't find a file, and the problem seemed theme related.  Then it dawned on me that I had switched themes before the reinstall but didn't have that theme available any longer.  The theme state must be held in the database and the database wasn't in the directories I recovered from backup.

I tried dropping some theme related items from the config table in the database, but it didn't get me anywhere.  Since this was a test install, I just went nuclear and dropped all the tables and reinstalled.

When I eventually do have a gallery of images set up, and find myself in the same position, what's the best recovery strategy?  How can I force Piwigo back to a default config without losing the image database?

Piwigo version: 2.7.2
Operating system: Darwin
PHP: 5.5.14 (Show info) [2014-12-03 02:16:56]
MySQL: 5.6.21 [2014-12-03 02:16:56]
Graphics Library: External ImageMagick 6.9.0-0

Last edited by Analog Kid (2014-12-03 19:09:28)

Offline

 

#2 2014-12-03 19:58:33

SnotRocket
Member
2014-08-15
63

Re: Loss of sync between db and file structure

Run backups before you screw around ;)

Dump the DB to a file... SSH/Rsync your site to your local machine or some other location.

That's basically what I have done... I get full DB dumps and RSYNC backups every night.

Last edited by SnotRocket (2014-12-03 20:00:10)

Offline

 

#3 2014-12-04 05:55:35

Analog Kid
Member
2014-12-03
6

Re: Loss of sync between db and file structure

I had the backup-- only did a partial restore, but I had it.

The question though is how to get Piwigo to a baseline config.  In this case, for example, I replaced the file structure with a new installation-- unless I wanted to revert to 2.7.1 (which, granted, wouldn't be the end of the world) I couldn't fix it with a restore from backup.  The database wanted a theme that the filesystem didn't contain.

I would have hoped that Piwigo would fall back to a default theme, for example, if it can't find the one recommended by the database, or that there would be a way to force it to.

Offline

 

#4 2014-12-04 11:11:07

flop25
Piwigo Team
2006-07-06
7037

Re: Loss of sync between db and file structure

going to the database and changing the theme to default or elegant or clear ... which are all provided theme is the way to force the system


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2014-12-04 18:58:52

Analog Kid
Member
2014-12-03
6

Re: Loss of sync between db and file structure

flop25 wrote:

going to the database and changing the theme to default or elegant or clear ... which are all provided theme is the way to force the system

Thanks.  Which table and column?  When I look at piwigo_config I see mobile_theme and mail_theme but neither match the default theme set through the interface.

There must be a per user setting somewhere too?  The piwigo_users table doesn't include it.

Offline

 

#6 2014-12-20 08:45:36

Analog Kid
Member
2014-12-03
6

Re: Loss of sync between db and file structure

Having played with Piwigo a bit more, it seems like if I were to get into a state with a bad theme, I could still get to the /admin page because it uses a different theme set?

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact