Full backup Photoprism

DuMbh3aD

Dabbler
Joined
Dec 6, 2022
Messages
17
Hello,
How can I do a full photoprism backup?
I'm currently doing a Replication Task on the originals folder, but if something happens to the server how do I restore the database with meta data, people, albums, etc.?
I have not included and set "Custom Host Path for Photo Prism Storage Volume".
I am also doing a Replication Task on the ix-applications dataset, but I am not sure if and how this will help me.
 

ChrisRJ

Wizard
Joined
Oct 23, 2020
Messages
1,919
That is a question for the application vendor. In general, I would recommend to shut down the application in question for the duration of the backup. For commercial applications, esp. database servers and MS Exchange, there are agents for backup software. But that adds a lot of complexity and if a short downtime is possible, the temporary shutdown is always the easiest solution.
 

DuMbh3aD

Dabbler
Joined
Dec 6, 2022
Messages
17
Here are instructions on how to make a backup
What I don't understand is where to write these commands, in system shell or in app shell or somewhere else?
If I Enable Custom Host Path for Photo Prism Storage Volume to do replication tasks on a storage volume will I break something?

1681371106404.png
 

eirik.lars1

Explorer
Joined
Jul 16, 2016
Messages
55
Did you find a solution for this? I have to reinstall the photoprism app because of some truechart update and I have to make a backup of the database.
 

DuMbh3aD

Dabbler
Joined
Dec 6, 2022
Messages
17
Yes.
First, you need to log in to the GUI as root (admin has no rights). Then in System Settings -> Shell you write:
docker ps -> to see what the container is called. In my case it is "k8s_photoprism_photoprism-86dfdcb8c-4gwm7_ix-photoprism_2818e5ad-93f8-485a-9c20-30d48eb7b6cd_1"
And after this:
docker exec -t k8s_photoprism_photoprism-86dfdcb8c-4gwm7_ix-photoprism_2818e5ad-93f8-485a-9c20-30d48eb7b6cd_1 sqlite3 /photoprism/storage/index.db .dump > /mnt/Pool/HomeData/BackUps/photoprism-db.sql

Now I'm looking for a simple way to copy /photoprism/storage/ to /mnt/Pool/HomeData/BackUps/photoprismstorage.zip

What I do is through Apps -> Installed Applications -> the three dots on photoprism -> shell
zip /originals/storage.zip -r storage
And then I move the archive to the backup folder
 

eirik.lars1

Explorer
Joined
Jul 16, 2016
Messages
55
Yes.
First, you need to log in to the GUI as root (admin has no rights). Then in System Settings -> Shell you write:
docker ps -> to see what the container is called. In my case it is "k8s_photoprism_photoprism-86dfdcb8c-4gwm7_ix-photoprism_2818e5ad-93f8-485a-9c20-30d48eb7b6cd_1"
And after this:
docker exec -t k8s_photoprism_photoprism-86dfdcb8c-4gwm7_ix-photoprism_2818e5ad-93f8-485a-9c20-30d48eb7b6cd_1 sqlite3 /photoprism/storage/index.db .dump > /mnt/Pool/HomeData/BackUps/photoprism-db.sql

Now I'm looking for a simple way to copy /photoprism/storage/ to /mnt/Pool/HomeData/BackUps/photoprismstorage.zip

What I do is through Apps -> Installed Applications -> the three dots on photoprism -> shell
zip /originals/storage.zip -r storage
And then I move the archive to the backup folder
Thank you! Will this command work with MariaDB also?

I get four results for photoprism:

Code:
d084d60db987   28e6bbfe11f9                          "/scripts/entrypoint…"   23 hours ago   Up 23 hours             k8s_photoprism_photoprism-5fb8d6dd88-rwvdh_ix-photoprism_62250c85-0c07-42a1-9720-0eebc378e448_0
c155dc50dff8   e4ecd1138c50                          "/opt/bitnami/script…"   23 hours ago   Up 23 hours             k8s_photoprism-mariadb_photoprism-mariadb-0_ix-photoprism_7baafe5c-0cc6-4070-8673-2bc285cd3cb0_0
7aad7308d6a9   rancher/mirrored-pause:3.6            "/pause"                 23 hours ago   Up 23 hours             k8s_POD_photoprism-mariadb-0_ix-photoprism_7baafe5c-0cc6-4070-8673-2bc285cd3cb0_0
834cbab8278e   rancher/mirrored-pause:3.6            "/pause"                 23 hours ago   Up 23 hours             k8s_POD_photoprism-5fb8d6dd88-rwvdh_ix-photoprism_62250c85-0c07-42a1-9720-0eebc378e448_0


Running the command on each of these only results in a file 135 bytes in size.
 

DuMbh3aD

Dabbler
Joined
Dec 6, 2022
Messages
17
Hello,
I tried on my mother-in-law's server.
Code:
root@truenas[~]# docker ps
CONTAINER ID   IMAGE                        COMMAND                  CREATED          STATUS          PORTS     NAMES
1de74266cdea   e6f531bbf1b0                 "/scripts/entrypoint…"   23 minutes ago   Up 23 minutes             k8s_photoprism_photoprism-veska-5d67766986-bthjw_ix-photoprism-veska_6e7b6a6b-e400-46a3-8088-8441945a3ef1_0
a197b0e0e9f4   rancher/mirrored-pause:3.6   "/pause"                 23 minutes ago   Up 23 minutes             k8s_POD_photoprism-veska-5d67766986-bthjw_ix-photoprism-veska_6e7b6a6b-e400-46a3-8088-8441945a3ef1_0
05f8096849b8   fe0f921f3c92                 "/csi-provisioner --…"   3 weeks ago      Up 3 weeks                k8s_csi-provisioner_openebs-zfs-controller-0_kube-system_539d7fd1-1832-4597-bbc4-98e1b215d54e_36
37321de89de0   799dd237b657                 "/init"                  3 weeks ago      Up 3 weeks                k8s_plex_plex-veska-7bc99695b8-7s45m_ix-plex-veska_d5850eae-cdc5-41c7-8476-5287635b74e7_27
42c8c9b9ef93   f1d8a00ae690                 "/snapshot-controlle…"   3 weeks ago      Up 3 weeks                k8s_snapshot-controller_openebs-zfs-controller-0_kube-system_539d7fd1-1832-4597-bbc4-98e1b215d54e_3
fee8cef5040c   0aa9629e1508                 "/csi-resizer --v=5 …"   3 weeks ago      Up 3 weeks                k8s_csi-resizer_openebs-zfs-controller-0_kube-system_539d7fd1-1832-4597-bbc4-98e1b215d54e_3
68328a519fdf   da32a49a903a                 "/csi-snapshotter --…"   3 weeks ago      Up 3 weeks                k8s_csi-snapshotter_openebs-zfs-controller-0_kube-system_539d7fd1-1832-4597-bbc4-98e1b215d54e_3
7989d1d47ef7   e6f531bbf1b0                 "/scripts/entrypoint…"   3 weeks ago      Up 3 weeks                k8s_photoprism_photoprism-nina-6f8c4c5c99-dr5cn_ix-photoprism-nina_6b718e88-0b0e-4519-9ebb-7f6d39ae1fb8_1
e3a42cc15876   99376d8f35e0                 "/coredns -conf /etc…"   3 weeks ago      Up 3 weeks                k8s_coredns_coredns-75fc8f8fff-44ncq_kube-system_8e61abad-7962-491a-85b8-b29010a5a99a_1
1e530e3d0537   rancher/mirrored-pause:3.6   "/pause"                 3 weeks ago      Up 3 weeks                k8s_POD_photoprism-nina-6f8c4c5c99-dr5cn_ix-photoprism-nina_6b718e88-0b0e-4519-9ebb-7f6d39ae1fb8_1
7c0b314f92d8   rancher/mirrored-pause:3.6   "/pause"                 3 weeks ago      Up 3 weeks                k8s_POD_coredns-75fc8f8fff-44ncq_kube-system_8e61abad-7962-491a-85b8-b29010a5a99a_1
33b79d035dc0   2e17748d7c44                 "/usr/local/bin/zfs-…"   3 weeks ago      Up 3 weeks                k8s_openebs-zfs-plugin_openebs-zfs-controller-0_kube-system_539d7fd1-1832-4597-bbc4-98e1b215d54e_1
9f6eda15cc34   f2c60b24fad8                 "/usr/local/bin/inte…"   3 weeks ago      Up 3 weeks                k8s_intel-gpu-plugin_intel-gpu-plugin-5cpw7_kube-system_4496a5a4-0821-4466-a2a3-7548cb0d3c2a_1
4aa377131550   rancher/mirrored-pause:3.6   "/pause"                 3 weeks ago      Up 3 weeks                k8s_POD_intel-gpu-plugin-5cpw7_kube-system_4496a5a4-0821-4466-a2a3-7548cb0d3c2a_1
420655dcaddf   rancher/mirrored-pause:3.6   "/pause"                 3 weeks ago      Up 3 weeks                k8s_POD_openebs-zfs-controller-0_kube-system_539d7fd1-1832-4597-bbc4-98e1b215d54e_1
32027c57d189   2e17748d7c44                 "/usr/local/bin/zfs-…"   3 weeks ago      Up 3 weeks                k8s_openebs-zfs-plugin_openebs-zfs-node-wjkvz_kube-system_6839f5e4-5718-48cb-8243-32217c63c368_1
c66b3f3caa29   368ee7d6e60f                 "/csi-node-driver-re…"   3 weeks ago      Up 3 weeks                k8s_csi-node-driver-registrar_openebs-zfs-node-wjkvz_kube-system_6839f5e4-5718-48cb-8243-32217c63c368_1
c4a4d3af175c   rancher/mirrored-pause:3.6   "/pause"                 3 weeks ago      Up 3 weeks                k8s_POD_openebs-zfs-node-wjkvz_kube-system_6839f5e4-5718-48cb-8243-32217c63c368_1
d665475cd38e   rancher/mirrored-pause:3.6   "/pause"                 3 weeks ago      Up 3 weeks                k8s_POD_plex-veska-7bc99695b8-7s45m_ix-plex-veska_d5850eae-cdc5-41c7-8476-5287635b74e7_1

root@truenas[~]# docker exec -t k8s_photoprism_photoprism-veska-5d67766986-bthjw_ix-photoprism-veska_6e7b6a6b-e400-46a3-8088-8441945a3ef1_0 sqlite3 /photoprism/storage/index.db .dump > /mnt/Pool/Data/Backups/PhotoPrism-DB.sql


Strangely, a 128 byte file is generated for me too.
I went into Apps->Installed Applications->3 dots->shell to check if I'm in the right container

k8s_photoprism_photoprism-veska-5d67766986-bthjw_ix-photoprism-veska_6e7b6a6b-e400-46a3-8088-8441945a3ef1_0

1682490677236.png


I went back to System Settings->Shell up arrow and enter and the "miracle" happened, a 509MB file was generated.
There are 2 photoprisms installed on this server. I tried the other one too
Code:
root@truenas[~]# docker exec -t k8s_photoprism_photoprism-nina-6f8c4c5c99-dr5cn_ix-photoprism-nina_6b718e88-0b0e-4519-9ebb-7f6d39ae1fb8_1 sqlite3 /photoprism/storage/index.db .dump > /mnt/Pool/Data/Backups/Nina.sql

A 321MB file is generated here for the first time.
 
Last edited:
Top