As I’m sure you already gathered from the first three posts, I am performing a major upgrade to my server setup. I know that I said in the last post that I would talk about my WordPress, but as I review my history and logs, I actually had an intermission here in my setup of WordPress where I worked on my Piwigo instance. The reason for this was that, as of the last post, my Nextcloud service and web server were up and running, and at that time, a quick look at my blog online, it loaded up and I thought it *was* working. Only later did I realize it had issues.
For the uninformed, Piwigo [1] is a great open source software for managing photos online. It is a web platform where you can share photos, showcase your artwork, and generally keep your photographs organized. In general, I think it is better for an artist trying to sell/showcase their work, or an event organizer, or a business, but I was using it to hold our family photos for a few years before I switched over to Nextcloud.
Nextcloud had many advantages, such as syncing our phone photographs and more, and when I originally switched to NC, I only left the Piwigo server rolling because I had used it for so long. Many years worth of photographs and family videos were already archived, had likes and faves, as well as organized in a way we wanted them to be.
However, at this point during the upgrade, the new server now was on PHP 8.2, and the older version of Piwigo I was using was only able to utilize PHP 7.4 or older. Also there was a little trouble with the MariaDB mySQL export from the old server and import into the new server. Piwigo was really good software, but another thing I found was that we generally didn’t go to our instance of Piwigo very often, and I didn’t want to have to maintain it. So I decided to move all of the photographs and videos from Piwigo to our Nextcloud.
Rather than use the web GUI, I wanted to just copy all of the photos over and scan them all from the command line to add them to Nextcloud. Fortunately, that was pretty easy. My photographs were already grouped in folders based on year, so I started by copying them from the Piwigo folder to the Nextcloud user folder.
$ sudo su # You have to use sudo or root permissions to view anything in the Nextcloud data folder, due to permission settings.
# cd /var2/www/nextcloud-data/USERNAME/files/
# cp -Rav /var2/www/piwigo/galleries/2014andOlder ./2014andOlder
# cp -Rav /var2/www/piwigo/galleries/2015 ./2015
# cp -Rav /var2/www/piwigo/galleries/2016 ./2016
.... and again for each gallery folder that I wanted to copy over ....
# exit
Then, back as a regular user, and back in my Nextcloud web server folder, I had to run this command to synchronize all those photos and videos that I added:
$ sudo -u www-data php occ files:scan --all
Since this was synchronizing and scanning 6 years worth of photos and videos, it took a few minutes to get this done, but once it was complete, it was all available in the web GUI for view! The next thing I almost did was to edit my Apache2 config files so as not to serve up that web page anymore. Instead, I thought of a new use for it, and for the moment just emptied the Piwigo folder and put a simple index.html file in it to say the website was under maintenance. We will see what I can come up with instead….
Linux – keep it simple.