#1 2024-07-28 14:15:13

nickO
Member
2021-01-11
30

Moving Piwigo to a new machine.

Hello,

I have the latest version of Piwigo and I would like to move it to a new machine. I am not very savvy with this sort of thing so I’m looking for the easiest way and not necessarily the fastest one!

Currently, Piwigo is running with Docker and I use Portainer to manage my stacks, containers, etc. I use nginx proxy manager for WAN access and I am pretty Good with basic command line stuff over ssh.

I would lie to move all images and keep their tags, albums, etc. There are only three users and I would like to move these. Ideally, I would lie it all to just work as I does on the current server but happy to do extra legwork for a simpler way of doing things.

I hope all of that makes sense. I have searched for guides but most are way above my head.

Thank you for this awesome project, it has been a game changer for me and my family being able to have somewhere to look at all our photos which were previously just stored on drives and never looked at.

All the best,
Nick.

Last edited by nickO (2024-07-28 14:16:10)

Offline

 

#2 2024-07-29 02:59:33

raupie
Member
2023-07-11
46

Re: Moving Piwigo to a new machine.

Sounds like a docker setup.

Is the database also running on a container?

Do you have a backup system to restore just in case things go to hell?

I haven't seen a guide or plugin that specializes in backups. I run on a Linuxserver.io piwigo/swag/mariadb and just backup the config folders and take daily mysqldumps.

Offline

 

#3 2024-07-29 10:34:36

erAck
Only trying to help
2015-09-06
2183

Re: Moving Piwigo to a new machine.

That's basically it. Do a mysqldump of the entire Piwigo database using

Code:

mysqldump --add-locks --allow-keywords --lock-all-tables --databases YourDatabaseName > backup-file.sql

and backup the entire Piwigo installation tree including all picture folders {upload/,galleries/}. You may exclude the directories under _data/* of temporary files, those will be recreated as needed. On the target system recreate the database from the SQL dump file using

Code:

mysql YourDatabaseName < backup-file.sql

and restore the installation's file tree, create the _data/ directory as well if you didn't back it up, then adapt the settings in the local/config/database.inc.php file to match the new database location and credentials. Check directory and file permissions to meet the server users' requirements and chmod if required, see [Forum, post 180666 by erAck in topic 28678] Http Error 500.


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

Offline

 

#4 2024-07-29 16:04:36

nickO
Member
2021-01-11
30

Re: Moving Piwigo to a new machine.

raupie wrote:

Sounds like a docker setup.

Is the database also running on a container?

Do you have a backup system to restore just in case things go to hell?

I haven't seen a guide or plugin that specializes in backups. I run on a Linuxserver.io piwigo/swag/mariadb and just backup the config folders and take daily mysqldumps.

Hi, thank you.

Yes, this is on Docker and I do have a backup up everything.I am also running the Linuxserver.io service.

I have this file structure:

Code:

root@omvper210:/NAS/appdata/piwigo# ls -l
total 4
drwxr-sr-x 10 docker1 users 4096 Jun 10  2023 gallery

and ...

Code:

root@omvper210:/NAS/appdata/piwigoconfig# ls -l
total 8
drwxr-sr-x 8 docker1 users 4096 May  2  2023 data
drwxr-sr-x 4 docker1 users 4096 May  2  2023 db

Hopefully that makes sense.

Thanks,
Nick.

Last edited by nickO (2024-07-29 20:04:14)

Offline

 

#5 2024-07-29 16:06:08

nickO
Member
2021-01-11
30

Re: Moving Piwigo to a new machine.

erAck wrote:

That's basically it. Do a mysqldump of the entire Piwigo database using

Code:

mysqldump --add-locks --allow-keywords --lock-all-tables --databases YourDatabaseName > backup-file.sql

and backup the entire Piwigo installation tree including all picture folders {upload/,galleries/}. You may exclude the directories under _data/* of temporary files, those will be recreated as needed. On the target system recreate the database from the SQL dump file using

Code:

mysql YourDatabaseName < backup-file.sql

and restore the installation's file tree, create the _data/ directory as well if you didn't back it up, then adapt the settings in the local/config/database.inc.php file to match the new database location and credentials. Check directory and file permissions to meet the server users' requirements and chmod if required, see [Forum, post 180666 by erAck in topic 28678] Http Error 500.

Hi there, thanks you for helping.

So, those commands just go in an ssh terminal?

Cheers,
Nick.

Offline

 

#6 2024-07-30 01:29:10

erAck
Only trying to help
2015-09-06
2183

Re: Moving Piwigo to a new machine.

Yes. In a docker setup you may have to prefix it with whatever is needed to execute a command in the docker database environment. I don't use docker.


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

Offline

 

#7 2024-07-30 02:34:44

raupie
Member
2023-07-11
46

Re: Moving Piwigo to a new machine.

If you are using linuxserver.io images then each one should have a "/config" folder that stores everything in a mount to the host machine.

You should be able to just copy the entire project to other machine as is and run a docker-compose up

All the previous steps are for manual backups by hand. My impression is you want to get this current setup running on another host with the same images etc.

On my phontonOS VM on trueNAS I have 3 volumes.

Docker /mnt/docker/piwigo
Data /mnt/data/piwigo/{piwigo, MySQL}
NFS /mnt/photos/{albums,other}

Basically all the docker stuff goes in docker and all the container mounts that stores the config goes in Data.

Last edited by raupie (2024-07-30 02:35:10)

Offline

 

#8 2024-07-31 14:52:27

nickO
Member
2021-01-11
30

Re: Moving Piwigo to a new machine.

raupie wrote:

If you are using linuxserver.io images then each one should have a "/config" folder that stores everything in a mount to the host machine.

You should be able to just copy the entire project to other machine as is and run a docker-compose up

All the previous steps are for manual backups by hand. My impression is you want to get this current setup running on another host with the same images etc.

On my phontonOS VM on trueNAS I have 3 volumes.

Docker /mnt/docker/piwigo
Data /mnt/data/piwigo/{piwigo, MySQL}
NFS /mnt/photos/{albums,other}

Basically all the docker stuff goes in docker and all the container mounts that stores the config goes in Data.

Thank you,

Yes, this sounds like what i want to do. I try to run all my compose files in Portainer (WebGUI), so what would i do in this case, copy everything over and then deploy the stack in Portainer?

I keep all my images in Piwigo itself.

Thanks again,
Nick.

Last edited by nickO (2024-07-31 14:53:29)

Offline

 

#9 2024-07-31 15:00:43

raupie
Member
2023-07-11
46

Re: Moving Piwigo to a new machine.

I use portainer as a container UI but still prefer hands on `docker` & `docker-compose` CLI commands. I don't believe there is a way to move things to another host with that software, it's more container orchestration.

You would most likely want to get your docker and docker-compose setups working on the new host. With portainer as well. Then you would need to manually lift the folders/files that makes up your docker piwigo project. Either copy those files to a usb drive, network mount, scp/rsync.

Offline

 

Board footer

Powered by FluxBB

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