Piwigo move the galleries folder on another hard drive / Changer l'emplacement de ./galleries pour qu'il soit sur un grand disque dur

Hello,
i would like get a hard drive as ./galleries folder of piwigo.
I already have a hard drive with almost 3t of photos and video.
How can i manage it ?

Bonjour,
je voudrais utilser un disque dur en tant que dossier ./galleries de piwigo.
J’ai déjà ce disque dur avec près de 3 tera de photos et de vidéos.
Comment puis-je le gérer?

Merci

I suppose something like this could do the job. I have not tested it and don’t know piwigo verywell.

Connect the hard drive and identify it

fdisk -l

You need to find something like /dev/sdX with the good size of your hdd

Mount it

mkdir /mnt/my_hdd
mount /dev/sdX /mnt/my_hdd

Make a symbolic link

link gallerties to this hard drive disk

mv /var/www/piwigo/galleries /var/www/piwigo/galleries_old
ln -s PATH_TO_DISK /var/www/piwigo/galleries

And i think it could be ok

Hello,
I followed your advice.
Here exactly what i did:

lsblk

to get all the disk connect to my system

Find my the disk where are my photos

blkid | grep "/dev/your disk sdbX or something:"
Find and note the uuid and label if there are any

Create a folder in /media to mount the disk
mkdir /media/label of your disk or name where you want to mount it

Automatic mount of the disk with fstab
nano /etc/fstab

Add the line of your disk
UUID=cea0b7ae-2fbc-4f01-8884-3cb5884c8bb7 /media/label of your disk or name where you want to mount it ext4 defaults,nofail 0 0

check if the drive disk is ready lsblk
you must have something like this
`NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

sda 8:0 0 931.5G 0 disk
└─sda1 8:1 0 931.5G 0 part
├─sda2 179:1 0 47.7M 0 part /boot
└─sda3 179:2 0 14.8G 0 part /
sdb 8:0 3 900.5G 0 disk
└─sdb1 8:1 3 900.5G 0 part /media/label of your disk or name where you want to mount it`

After i apply your symbolic link recipe
`mv /var/www/piwigo/galleries /var/www/piwigo/galleries_old

ln -s /media/label of your disk or name where you want to mount it /var/www/piwigo/galleries`

In piwigo i got all the folders of my disk ! success

BUT
I got a problem
No picture .
How can i get my pictures
and
My videos 3g, mp4, Mov

When i launch a sync
i got this error :
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 20480 bytes) in /var/www/piwigo/admin/site_update.php on line 543

Any ideas…?

thanks

/////////////////////French-Style////////////////////

Bonjour,
J’ai suivi ton conseil.
Voici exactement ce que j’ai fait:

lsblk

pour connecter tout le disque à mon système

Trouvez mon disque où sont mes photos

blkid | grep "/ dev / votre disque sdbX ou quelque chose:"
Trouvez et notez l’uuid et/ou son nom s’il y en a

Créez un dossier dans / media pour monter le disque
mkdir / media / label de votre disque ou nom où vous voulez le monter

Montage automatique du disque avec fstab
nano / etc / fstab

Ajoutez la ligne de votre disque
UUID = cea0b7ae-2fbc-4f01-8884-3cb5884c8bb7 / media / label de votre disque ou nom où vous souhaitez le monter par défaut ext4, nofail 0 0

vérifier si le disque du lecteur est prêt lsblk
vous devez avoir quelque chose comme ça

`NAME MAJ: MIN RM SIZE RO TYPE MOUNTPOINT

sda 8: 0 0 931.5G 0 disque
└─sda1 8: 1 0 931.5G 0 partie
├─sda2 179: 1 0 47,7 M 0 partie / démarrage
└─sda3 179: 2 0 14.8G 0 partie /
disque sdb 8: 0 3900.5G 0
└─sdb1 8: 1 3 900.5G 0 partie / support / étiquette de votre disque ou nom où vous souhaitez le monter`

Après avoir appliqué votre recette de lien symbolique
`mv / var / www / piwigo / galleries / var / www / piwigo / galleries_old

ln -s / media / label de votre disque ou nom où vous souhaitez le monter / var / www / piwigo / galleries`

Dans piwigo j’ai eu tout les dossiers de mon disque! Succès

MAIS

J’ai un problème
Pas d’image .
Comment obtenir mes photo
et
Mes vidéos 3g, mp4, Mov

Quand je lance une synchronisation
j’ai cette erreur:

Erreur fatale: la taille de la mémoire autorisée de 67108864 octets est épuisée (a tenté d'allouer 20480 octets) dans /var/www/piwigo/admin/site_update.php sur la ligne 543

Des idées…?

Merci

hello,
to get it work you need to set the chmod and chown
So i make it like that:
chown -R piwigo:piwigo /media/label of your disk or name where you want to mount it
chmod 775 -R /media/label of your disk or name where you want to mount it
After that i do:
systemctl stop nginx
and
systemctl start nginx

Now i got my pictures and videos

to play video i got to install piwigo-jplayer plugins from the admin of app piwigo

but i got that error:
Fatal error: 'break' not in the 'loop' or 'switch' context in /var/www/piwigo/plugins/piwigo-jplayer/include/getid3/getid3.lib.php on line 285

so i need to change getid3.lib.php
i’d just comment the line 285 with // in nano
to get line numbers i do:
nano ~/.nanorc
it’s an easy way to configure this txteditor
i’d just put this line:
set linenumbers
ctrl-O, ctrl-X

It seems to work but no thumbnails…

::::::::::::::::French-style:::::::::::::::::::::::::::

Bonjour,
pour le faire fonctionner, vous devez définir le chmod et chown
Donc je le fais comme ça:
chown -R piwigo: piwigo / media / label de votre disque ou nom où vous voulez le monter
chmod 775 -R / media / label de votre disque ou nom où vous voulez le monter
Après cela, je fais:
systemctl stop nginx
et
systemctl start nginx

Maintenant j’ai mes photos et vidéos

pour lire la vidéo, je dois installer les plugins piwigo-jplayer depuis l’admin de l’application piwigo

mais j’ai eu cette erreur:
Fatal error: 'break' not in the 'loop' or 'switch' context in /var/www/piwigo/plugins/piwigo-jplayer/include/getid3/getid3.lib.php on line 285

donc j’ai besoin de changer getid3.lib.php
je voudrais juste commenter la ligne 285 avec // avec nano
pour obtenir les numéro de ligne et aller plus vite je modifie la config de nano dans le home
nano ~/.nanorc
façon facile de customiser nano
j’ai ajouter cette ligne:
set linenumbers
ctrl-O, ctrl-X

On dirait que cela fonctionne mais pas de thumbnails/vignettes.

Hello,
i got a problem, i can see all my album and old folders from shotwell and iphoto stuff before 2012… But i need to sync each folder separately.
So it’s like an expedition…
If i launch quick sync i got

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 20480 bytes) in /var/www/piwigo/admin/site_update.php on line 543

i apply the solution in this link: https://piwigo.org/forum/viewtopic.php?id=27887
but it don’t work.

Can i use a parse command to scan all my disk…?
You need to know i got 3terabytes of pictures and videos…

============french-style=========
Bonjour,
j’ai un problème, je peux voir tous mes albums et anciens dossiers de Shotwell et d’iphoto avant 2012 … Mais j’ai besoin de synchroniser chaque dossier séparément.
C’est donc comme une expédition …
Si je lance la synchronisation rapide, j’ai

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 20480 bytes) in /var/www/piwigo/admin/site_update.php on line 543

j’applique la solution dans ce lien: [Quick Local Synchronization : Fatal Error: Allowed Memory Size Exhaust | Piwigo.org diplomatique(Quick Local Synchronization : Fatal Error: Allowed Memory Size Exhaust | Piwigo.org)
mais ça ne marche pas.

Puis-je utiliser une commande d’analyse pour analyser tout mon disque …?
Vous devez savoir que j’ai 3 téraoctets de photos et de vidéos …

salut

J’avais transporté pwiwigo sur un disque externe, j’ai documenté ça ici https://linuq.org/auto-heber/yuno-piwigo
Depuis j’ai carrément mis yunohost en démarrage sur le disque externe et ça démarre et marche parfaitement sans la carte sd : https://linuq.org/auto-heber/yuno-transfert-d-ext

1 Like

Hello,
merci pour vos liens…
J’ai tenté autre chose.
Mon soucis est que le disque dur contient déjà toutes les images.
je suis sur un desktop.
À la lecture de vos tuto je me rend compte qu’il s’agit plutôt de parametrer piwigo pour qu’il scanne le disque et Re-construisent les albums et leurs contenus
cordialement

english-style___
Hello,
thanks for your links …
I tried something else.
My concern is that the hard drive already contains all the images.
I’m on a desktop.
When Reading your tutorial I realize that it is rather a question of setting in piwigo,
I need that piwigo scans the disc and Re-build albums and their contents
cordially

Hello,
Did you apply the fix you’re referring to (on Piwigo forums) to /etc/php/7.0/fpm/pool.d/piwigo.conf?

Hello
yes i even increase the memory to 3000M
I also try some nginx custom by changing the piwigo. conf and php.ini to set a longer time for response… Nothing really work

Hello,
it seem to work but it always finish by errors

[error] upstream timed out (110: Connection timed out) while reading response header from upstream, client: server: edit.ynh.fr, request: “GET /piwigo/admin.php?page=site_update&site=1&quick_sync
=1&pwg_token=b20eceda80553f48ed33a5e8738d8767 HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm-piwigo.sock”, host: “edit.ynh.fr”, referrer: “https://edit.ynh.fr/piwigo/admin.php

or

2020/02/29 16:27:32 [alert] 823#823: worker process 5180 exited on signal 6
2020/02/29 16:27:32 [alert] 823#823: shared memory zone “memstore” was locked by 5180
2020/02/29 16:27:32 [error] 5179#5179: MEMSTORE:05: my procslot not found! I don’t know what to do!
ker process is shutting down: /build/nginx-DhOtPd/nginx-1.10.3/debian/modules/nchan/src/store/memory/memstore.c:1616: nchan_store_exit_worker: Assertion `0’ failed.
2020/02/29 16:27:32 [alert] 823#823: worker process 5179 exited on signal 6
2020/02/29 16:27:32 [alert] 823#823: shared memory zone “memstore” was locked by 5179
2020/02/29 16:27:37 [alert] 830#830: *40 open socket #28 left in connection 12
2020/02/29 16:27:37 [alert] 830#830: *42 open socket #30 left in connection 14

or

PHP message: PHP Warning: md5_file(././galleries/PHOTOTHEQUE/SHOTWELL_ALL_ORIGINALS/2007/07/13/24.jpg): failed to open stream: No such file o
2020/02/28 19:01:26 [error] 2116#2116: *10 FastCGI sent in stderr: “PHP message: PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 20480 bytes) in /var/www/piwigo/include/ws_core.inc.php on line 162” while reading response header from upstream, client: 2a01:e34:ed8f:b7d0:9e2b:29f3:c85e:90fb, server: edit.ynh.fr, request: “GET /piwigo/ws.php?format=json&method=pwg.categories.getAdminList HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php/php7.0-fpm-piwigo.sock:”, host: “edit.ynh.fr”, referrer: “https://edit.ynh.fr/piwigo/admin.php?page=photos_add&album=23513
2020/02/28 19:01:59 [error] 2116#2116: *10 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined offset: 0 in /var/www/piwigo/include/ws_functions/pwg.images.php on line 1429
PHP message: PHP Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘’ at line 4

so i believe there is a big work to accomplish and nginx or php-fpm or piwigo can’t handle it.
Can you help on a command to parse from piwigo to get the stuff put on the disk.
If launch
ls /var/www/piwigo/galleries
i can see in ssh all my folders put on the disk link before…
Thanks for helping

Difficult to help you as this seems tightly linked to Piwigo… Maybe can you post on their forum for more ideas…?

Thanks, i make it in the same time.
I’m searching a solution.

Hello,
i find a solution.
It’s difficult for piwigo to parse a complete disk.
Something goes wrong everytime, even if you just want to get the folders structure.

So i decide to create a galleries folder
mkdir /media/label of you hard-drive/galleries

All my photos and video are on the same drive/disk 500.000 photos and 70.000 videos
Thats why the piwigo sync process fail

Then i make a symbolic link on the new galleries folder

first move the galleries folder in /var/www/piwigo
mv /var/www/piwigo/galleries /var/www/piwigo/galleries_old

second make the symbolic link
ln -s /media/label of you hard-drive/galleries /var/www /piwigo/galleries

After you need to give the right chmod and chown to the folders.
First the galleries folder itself in /media/label of you hard-drive/galleries
Second each new folder you move from the /media/label of you hard-drive
so i proceed like this:
list of the stuff on /media/label of you hard-drive
ls /media/label of you hard-drive
Then move a folder of my pictures
mv /media/label of you hard-drive/FOLDER_PHOTO_ARLES /media/label of you hard-drive/galleries

At that moment piwigo see nothing… youhou !!!
Then:
chown -R piwigo:piwigo /media/label of your disk/galleries
AND
chmod 775 -R /media/label of your disk/galleries/FOLDER_PHOTO_ARLES
After you go on the piwigo admin to launch one or several process to sync first the folder structure and then the pictures and metadata
It’s an expedition !
I customize the piwigo.conf file to increase memory and time to proceed scripts…
nano /etc/php/7.0/fpm/pool.d/piwigo.conf
i change :
php_admin_value[memory_limit] =1512M
php_admin_value[upload_max_filesize] =4000M
php_admin_value[post_max_size] =5000M
others parameters
php_admin_value[max_execution_time] =6000
php_admin_value[memory_limit] =2560M
other parameters
php_admin_value[max_execution_time] =36000
php_admin_value[max_input_time =36000
I think it’s all what i change, the philosophy of that custom is to increase a lot the ressources and time for piwigo to run the sync.

It works but i need to repeat the process for each folder of my photolibrairy

Bye
===============french—Style=============
Bonjour,
j’ai trouvé une solution.
Il est difficile pour piwigo d’analyser un disque complet.
Quelque chose se passe mal à chaque fois, même si on veut simplement obtenir la structure des dossiers.

Je décide donc de créer un dossier de galleries
`mkdir / media / label de votre disque dur / galleries ’

Toutes mes photos et vidéos sont sur le même disque:
500 000 photos et 70 000 vidéos
C’est pourquoi le processus de synchronisation piwigo échoue

Ensuite je fais un lien symbolique sur le nouveau dossier galleries

déplacez d’abord le dossier des galleries dans / var / www / piwigo
mv / var / www / piwigo / galleries / var / www / piwigo / galleries_old

Ensuite faire le lien symbolique
ln -s / media / label de votre disque dur / galleries / var / www / piwigo / galleries

Après il faut les bons chmod et chown sur les dossiers.
D’abord le dossier des galleries lui-même dans / media / label de votre disque dur / galleries
Ensuite chaque nouveau dossier que vous déplacez depuis le / media / label de votre disque dur
alors je procède comme ceci:
liste des éléments sur / media / label de votre disque dur
ls / media / label de votre disque dur
Déplacez ensuite un dossier de mes photos
`mv / media / label de votre disque dur / FOLDER_PHOTO_ARLES / media / label de votre disque dur / galleries ’

A ce moment piwigo ne voit rien … youhou !!!
Alors:
chown -R piwigo: piwigo / media / label de votre disque / galleries
ET
chmod 775 -R / media / label de votre disque / galleries / FOLDER_PHOTO_ARLES

Après avoir accédé à l’administrateur piwigo,
lancez un ou plusieurs processus pour synchroniser d’abord la structure des dossiers, puis les images et les métadonnées
C’est une expédition!

Je personnalise le fichier piwigo.conf pour augmenter la mémoire et le temps de procéder aux scripts …
nano / etc / php / 7.0 / fpm / pool.d / piwigo.conf
je change :
php_admin_value [memory_limit] = 1512M
php_admin_value [upload_max_filesize] = 4000M
php_admin_value [post_max_size] = 5000M
autres paramètres
php_admin_value [max_execution_time] = 6000
php_admin_value [memory_limit] = 2560M
autres paramètres
php_admin_value [max_execution_time] = 36000
php_admin_value [max_input_time = 36000

Je pense que c’est tout ce que j’ai changé, la philosophie de ces actions est d’augmenter considérablement les ressources et le temps pour piwigo pour exécuter la synchronisation.

Cela fonctionne, mais je dois répéter le processus pour chaque dossier de ma photothèque

Salut

2 Likes

thanks for sharing information

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.