Announcement

#1 2023-04-26 17:01:48

paivadaniel
Member
2023-04-26
8

How to change the directory of my gallery?

Hello, I installled Piwigo in this environment:

Piwigo 13.6.0
OS: Linux
PHP: 8.1.2-1ubuntu2.11
MySQL: 5.5.5-10.6.12-MariaDB-0ubuntu0.22.04.1

I installed lamp, after I unziped Self-hosted Piwigo file to /var/www/html/piwigo, now I can access Piwigo in the Chrome browser typing: localhost/piwigo

I need to change my piwigo gallery folder to /media/Cursos/piwigo (that is, the place where I keep the photos), and dont break the database. How can I do it?

obs.: In docker it would be enough to add a volume for this, however I had problems installing Piwigo/MariaDB but that is a subject for another post.

Offline

 

#2 2023-04-27 00:34:55

erAck
Only trying to help
2015-09-06
2027

Re: How to change the directory of my gallery?

If you are speaking of physical albums and the so-called ftp sync, how about just symlinking the album folders into the Piwigo galleries/ directory? i.e.

Code:

ln -s /media/Cursos/piwigo/* /var/www/html/piwigo/galleries/

or whatever directories would be appropriate instead of /media/Cursos/piwigo/*


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2023-04-27 06:12:16

paivadaniel
Member
2023-04-26
8

Re: How to change the directory of my gallery?

I'm a beginner in Piwigo and I still don't quite understand how it works, I have my photos on a hd, when I insert them into Piwigo, it doesn't create a new file of photos?

I bought a hd to save space on my ssd, where I leave it only for my OS. So, I think it doesn't make sense to use symlinking, because the photos from Piwigo's albums will continue to occupy space on my ssd. How do I save the Piwigo albums in the hd (mounted in /media/Courses/)?

Offline

 

#4 2023-04-27 21:47:12

erAck
Only trying to help
2015-09-06
2027

Re: How to change the directory of my gallery?

It wasn't clear from your question that you do not want to keep your photos on the /media/Courses device.

You also didn't say if you have any directory structure there that you want to preserve as physical albums. If so, then just copy the entire tree into the /var/www/html/piwigo/galleries/ directory and run a ftp synchronization.


Running Piwigo at https://erack.net/gallery/

Offline

 

#5 2023-04-27 22:01:31

paivadaniel
Member
2023-04-26
8

Re: How to change the directory of my gallery?

quote: It wasn't clear from your question that you do not want to keep your photos on the /media/Courses device.

I will copy what I said in my first post: "I need to change my piwigo gallery folder to /media/Cursos/piwigo (that is, the place where I keep the photos), and dont break the database."

How can I do it?"

Offline

 

#6 2023-04-27 22:03:54

paivadaniel
Member
2023-04-26
8

Re: How to change the directory of my gallery?

I wanto to save my albums in /media/Cursos, so I want to move from /var/www/html/piwigo/galleries/ to /media/Cursos

Offline

 

#7 2023-04-28 01:12:28

erAck
Only trying to help
2015-09-06
2027

Re: How to change the directory of my gallery?

The "that is, the place where I keep the photos" lead me to where they currently are.. anyway..
So it's the other way round. Move the Piwigo galleries/ directory and content to /media/Cursos/piwigo and then either create a galleries symbolic link in /var/www/html/piwigo pointing to /media/Cursos/piwigo, or best (re)create a galleries directory and bind mount /media/Cursos/piwigo into it.


Running Piwigo at https://erack.net/gallery/

Offline

 

#8 2023-04-29 02:16:16

paivadaniel
Member
2023-04-26
8

Re: How to change the directory of my gallery?

Can you please explain how can I do this: "or best (re)create a galleries directory and bind mount /media/Cursos/piwigo into it"?

Reading your answer what comes to mind is:

1. sudo nano /etc/fstab
2. I dont know the instruction to do the mount, but something like:

# piwigo
/var/www/html/piwigo    /media/Cursos /media/pool/    defaults,allow_other,use_ino,hard_remove,nonempty       0       0

Offline

 

#9 2023-04-29 11:22:46

erAck
Only trying to help
2015-09-06
2027

Re: How to change the directory of my gallery?

man mount, Bind mount operation

Code:

mkdir /var/www/html/piwigo/galleries
mount --bind /media/Cursos/piwigo/galleries /var/www/html/piwigo/galleries

or in /etc/fstab:

Code:

/media/Cursos/piwigo/galleries /var/www/html/piwigo/galleries none bind

Running Piwigo at https://erack.net/gallery/

Offline

 

#10 2023-05-05 03:59:38

paivadaniel
Member
2023-04-26
8

Re: How to change the directory of my gallery?

In fact, the folder /var/www/html/piwigo/galleries didn't have anything inside, however, I tested it with that folder and with /var/www/html/piwigo/upload (which is where the photos are), and I tested both ways you wrote in your last answer, but both didn't work out.

Anyway, I deleted the manual installation of Piwigo (in which I had unzipped the file) and I want to install it using Docker, I would be grateful if you could take a look at this post where I describe the error I am having:

https://piwigo.org/forum/viewtopic.php? … 80#p186680

Offline

 

Board footer

Powered by FluxBB

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