Hello/Hi/Greetings,
Please, can anybody help me with Piwigo database? I have to say that I am only user of database and not IT specialist.
I have been using Piwigo for a long time Piwigo, unfortunately old version 2.9.3. I tried many times to make update but without success (during update, the database/Piwigo totally collapsed). My web provider did not help me. So I exchanged provider to another one. Anything looks smooth but at the end the new provider said that old Piwigo has function get_magic_quotes_gpc that is not supported by new PHP versions. So he installed new Piwigo (15, now I updated to 16). Unfortunately, no data were updated.
However, all previous information are available at MySQL subdirectory(-ies) phpwebgallery_ but the new Piwigo probably use the subdirectory(-ies) piwigo_ (for example phpwebgallery_categories versus piwigo_categories) where are new information.
Is any possibilities to change it, so Piwigo can use data from subdirectory(-ies) phpwebgallery_ instead of piwigo_ Some example is at attached inage.
I hope that I clearly described my problem and hope for any help. I have thousands photos of birds with various categories (i.e. classified). My web is: https://natureblink.com/ and gallery https://natureblink.com/galerie/index.php?.htm
(Copy here your environment details, found on your Piwigo page [Administration > Tools > Maintenance])
Piwigo 16.0.0 Zkontroluj nové aktualizace
Nainstalováno 21. listopadu 2025, před 4 dní
Operační systém: Linux (container)
PHP: 8.4.11 (Zobrazit informace) [2025-11-26 08:12:39]
MySQL: 11.8.3-MariaDB-0+deb13u1 from Debian-log [2025-11-26 08:12:39]
Grafická knihovna: GD 2.3.3
Velikost cache 0 Mo vypočteno před 11 hodin Aktualizovat
Piwigo URL: http://
Last edited by lanius (2025-11-26 18:07:50)
Offline
Please, can anybody help me? Is any possibility to change MySQL subdirectory(-ies)?
Sorry, I do not have any knowledge about databases.
Unfortunately, I have thousands photos that were previously categorised, and now it could be really time-consuming to do it again.
I appreciate any help.
Regards
Ivan
Offline
The database table prefix is set during the install process as there is a prompt for it. It appears to be stored as the "$prefixeTable" variable in the file "database.inc.php" in the /local/config/ directory under the Piwigo root directory.
As far as I know that variable can be changed to match your database, but I have never done that so I don't know what the implications are. I would personally want to make sure I had a good backup (export) and probably lock your gallery on the maintenance page first.
Then you might need to access the "upgrade.php" page on your Piwigo site after making the change in database.inc.php as well.
I have never done this myself so your mileage may vary.
Last edited by moberley (2025-11-27 13:14:22)
Offline
Thank you very much for your attempt to help me. Unfortunately, in database.inc.php is correct name of the directory (phpwebgallery_ instead used piwigo_). So I am confused from it.
Previously it was piwigo_ but I asked web hosting manager to change it to phpwebgallery_. Unfortunately, it doesn't help.
moberley wrote:
The database table prefix is set during the install process as there is a prompt for it. It appears to be stored as the "$prefixeTable" variable in the file "database.inc.php" in the /local/config/ directory under the Piwigo root directory.
As far as I know that variable can be changed to match your database, but I have never done that so I don't know what the implications are. I would personally want to make sure I had a good backup (export) and probably lock your gallery on the maintenance page first.
Then you might need to access the "upgrade.php" page on your Piwigo site after making the change in database.inc.php as well.
I have never done this myself so your mileage may vary.
Offline
Sorry. I don't have a solution for you.
But since you started with an old version it makes me wonder if some of the series of database updates did not get applied. These should be listed in the "phpwebgallery_upgrade" table in your database with the date when they were applied.
My v16 installation shows upgrades numbered from 61 to 181 when I look at that table.
Offline
Thank you very much for your help!
and yes - at phpwebgallery_upgrade is a plethora of data about update. Unfortunately I did not understand, what I can do it.
The last sentence is:
Edit Edit Copy Copy Delete Delete 152 2017-10-14 10:52:58 [migration from 2.8.0 to 2.9.2, 0.001 s] add 5 par...
So it means that my last upgrade was to version 2.9.2; however, this version was incompatible with the new PHP. So it was installed (by webmaster of my new webhosting) a new version of Piwigo.
I know that it is a little complicated. My old Piwigo on old web hosting is not working, but I can download database as sql file. Can it be helpful?
Thanks again for your kind attention to my problem.
moberley wrote:
Sorry. I don't have a solution for you.
But since you started with an old version it makes me wonder if some of the series of database updates did not get applied. These should be listed in the "phpwebgallery_upgrade" table in your database with the date when they were applied.
My v16 installation shows upgrades numbered from 61 to 181 when I look at that table.
Offline
I think you might need to run the upgrade script as shown here:
https://piwigo.org/guides/update/manual … ual-update
Assuming you already have a backup of your data as SQL file then it should be okay to do that.
Offline
Thank you very much,
I will try it today evening. I hope that it will be helpful. Thanks a lot!
moberley wrote:
I think you might need to run the upgrade script as shown here:
https://piwigo.org/guides/update/manual … ual-update
Assuming you already have a backup of your data as SQL file then it should be okay to do that.
Offline
Unfortunately upgrade is not possible to make - I obtained information that my version of Piwigo is up-to-date.
moberley wrote:
I think you might need to run the upgrade script as shown here:
https://piwigo.org/guides/update/manual … ual-update
Assuming you already have a backup of your data as SQL file then it should be okay to do that.
Offline
That is unfortunate. I am sorry but now I definitely do not have any more ideas about solving your problem.
Offline
Thank you for your efforts to help me. I will make one last attempt today, and after that I will make hand working on database.
Offline
1) can you show the content of your file local/config/database.inc.php (replace the password by a fake word)
2) are you 100% sure the list of database tables you showed in your screenshot matches https://natureblink.com/galerie/ ? Because this Piwigo seems to work perfectly fine and is obviously (for me) running version 16.
3) do you have a table "piwigo_activity" or "phpwebgallery_activity" ? (the screenshot says no, but please make sure)
4) what happens when you try to edit a photo or any action in the administration ? can you see activities on page [Administration > Users > Manage > tab Activities] ?
Offline
Hello,
Thank you very much for your interest in my problem. Here are my answers.
Ad 1)
<?php
$conf['dblayer'] = 'mysqli';
$conf['db_base'] = 'natureblinkcom01';
$conf['db_user'] = 'natureblinkco002';
$conf['db_password'] = 'wahucaGU';
$conf['db_host'] = '127.0.0.1';$prefixeTable = 'phpwebgallery_';
define('PHPWG_INSTALLED', true);
define('PWG_CHARSET', 'utf-8');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
$conf['show_php_errors'] = false;
$conf['show_warnings'] = false;
$conf['debug'] = false;
?>
2) Unfortunately I am not sure. Yes, Piwigo 16 is working correctly. However, the new Piwigo probably use the subdirectory(-ies) piwigo_ but previous (old and obsolete) version of Piwigo used phpwebgallery_ (for example phpwebgallery_categories versus piwigo_categories). In this old phpwebgallery_ are probably all the information about my categories that I need for my photos (like sorting of bird species, etc.). So I need to use phpwebgallery_ subdirectories instead piwigo_ - if I understand to it correctly. Or some renames/copy to piwigo_ ? I don’t know.
3) Yes, I have no table "piwigo_activity" or "phpwebgallery_activity"
4) yes, I see activities on page [Administration > Users > Manage > tab Activities] ?
BTW If you are really interested in it, I can send you access to all my data to have a look. I will be very happy for your any help.
plg wrote:
1) can you show the content of your file local/config/database.inc.php (replace the password by a fake word)
2) are you 100% sure the list of database tables you showed in your screenshot matches https://natureblink.com/galerie/ ? Because this Piwigo seems to work perfectly fine and is obviously (for me) running version 16.
3) do you have a table "piwigo_activity" or "phpwebgallery_activity" ? (the screenshot says no, but please make sure)
4) what happens when you try to edit a photo or any action in the administration ? can you see activities on page [Administration > Users > Manage > tab Activities] ?
Offline
In your database.inc.php, the database is "natureblinkcom01" but on your screenshot, you show "natureblinkcom". This is not the same database.
If you see the activities, you obviously have the table of the same name.
BTW If you are really interested in it, I can send you access to all my data to have a look. I will be very happy for your any help.
It's not that I'm "interested", it's more that "I'll fix it in 2 minutes if I have an access to both your filesystem and your database". Contact us on our contact form (link at the bottom of this page)
Offline
Of course, I will try to contact you - a few days before, I tried it without success, so I will try it again.
Thanks for any help.
Regards
plg wrote:
In your database.inc.php, the database is "natureblinkcom01" but on your screenshot, you show "natureblinkcom". This is not the same database.
If you see the activities, you obviously have the table of the same name.BTW If you are really interested in it, I can send you access to all my data to have a look. I will be very happy for your any help.
It's not that I'm "interested", it's more that "I'll fix it in 2 minutes if I have an access to both your filesystem and your database". Contact us on our contact form (link at the bottom of this page)
Offline