-
Notifications
You must be signed in to change notification settings - Fork 4
Migration Guide from the LinuxServer
This guide is dedicated to users of the LinuxServer container image (https://github.com/linuxserver/docker-piwigo)
The following commands are for MariaDB, if you are using mysql you can subsitute mariadb-dump by mysqldump.
Dump your database by running :
mariadb-dump -u '<MyUser>' '<MyDatabase> -p' | tee db_dump.sqlIf you are running your database in a container use this command instead :
docker exec -it '<ContainerName>' mariadb-dump -u <piwigodb_user> '<piwigodb>' -p | tee db_dump.sqlYou can now stop your container.
Copy the following folders to backup all of your images :
/path/to/appdata/gallery/upload
/path/to/appdata/gallery/galleries
Now we will do a clean install of the official container using the official guide : https://piwigo.org/guides/install/docker
Before starting the container edit the compose.yaml file and replace MARIADB_RANDOM_ROOT_PASSWORD=true by MARIADB_ROOT_PASSWORD= followed by a strong password that is not the same as your MARIADB_PASSWORD.
You can use the same truncate command that is in the guide to generate a strong password.
Copy over your files :
docker cp ./db_dump.sql CONTAINER-NAME-piwigo-db-1:/
docker cp /path/to/your/backup/upload CONTAINER-NAME-piwigo-main-1:/var/www/html/piwigo/upload
docker cp /path/to/your/backup/galleries CONTAINER-NAME-piwigo-main-1:/var/www/html/piwigo/upload/galleriesNow connect to your database container using docker exec -it piwigodockerofficiel-piwigo-db-1 bash and login to mariadb with mariadb -u root -p and the password you wrote in the compose file.
Create a database named piwigodb_import and grant the right GRANT ALL PRIVILEGES ON piwigodb_import.* TO piwigodb_user; and FLUSH PRIVILEGES; quit the mariadb shell
To import the database run mariadb -u root -p piwigodb_import < /db_dump.sql
Stop all containers by running docker compose down and restart them by running docker compose up -d
Edit piwigo-data/piwigo/local/config/database.inc.php replacing the database with piwigodb_import (Don't forget to adjust the table prefix if you modified it in your previous install)
You should be able to see all your images.