A Terrifying Morning.. 🤦🏻♂️
Well, this morning, I woke up to a shock because, my archive of photos and videos amounting to 15GB’s had been mysteriously disappeared. This happened while I was testing Photoprism and Seafile on my self hosted setup after this post. I was migrating my photos and videos from Nextcloud to Photoprism from WebDav. It caught me off-guard and this is just a note I want to make so that I can look back and laugh at my stupidity!
So, What Happened?
I was trying to move photos from Nextcloud to Photoprism (Docker). Photoprism has a feature where I can add a WebDav folder and it will sync the photos automatically. That’s great! Because I don’t need to download the photos manually and then upload it to Photoprism. I was seriously liking the whole process and it made my life a bit simpler while setting up these services. After the sync, I deleted the WebDav folder from Nextcloud (of which the photos were synced) like a good boy since the photos were already copied and started organising the photos in Photoprism.
It was genuinely a good productive day. Things had gone as per the plan and it couldn’t have been any better. And I called it a day and had a very sound sleep.
The next day, to my surprise, the photos that I carefully collected over the years were lost (Mysteriously). There was nothing more terrifying at that moment when I saw my gallery folder empty!!
Yeah, But How?
Apparently, Photoprism and Nextcloud folder was on sync. That means, whenever the folder in Nextcloud changes, Photoprism also does that change in its folder and its consequent database.
After the sync, Like I deleted the WebDav folder from Nextcloud (of which the photos were synced) like a good boy and started organising the photos in Photoprism.
This is where I did a blunder and everything was gone! Since Photoprism saw no photos in the Nextcloud folder, it went ahead and deleted everything from its folder. Simple!
And, How did you recover them?
So, Nextcloud has a built in trash feature which I had enabled while I had installed Nextcloud in my server. After the migration, I had deleted the Nextcloud folder in the Nextcloud web interface which will move the folder from files to files_trash.
It took me a while to get there since web_ui in Nextcloud was unresponsive and amidst all this confusion, I forgot that there was even a files_trash folder in the Nextcloud setup. I should have removed the Nextcloud <–> Photoprism sync first before deleting one of the folders.
Then a quick copy and import recovered all the photos and videos. However then I carefully deleted my Nextcloud without affecting any other components in the setup. Phew! it was a really long morning. A Lesson for Life.
Categorized under #Note
Tags : #Lessons4Life #Nextcloud #PhotoPrism #Seafile #Photos #Videos
Timestamp : #June2021