Announcement

  •  » Extensions
  •  » Piwigo Backup Plugin suggestion

#1 2015-09-29 06:24:06

kalel
Member
www.photofree.ga
2015-09-23
20

Piwigo Backup Plugin suggestion

Dear community

This is just an idea, not a necessity. A piwigo website backup plugin may be useful for running the script as their main website.

Essentially, it would:

- Backup all important Piwigo files (so no need to backup the entire server)
- Backup the database
The backup options may be standard ones like FTP, Google Drive, Dropbox, or a simple compressed file download to the user's computer. Perhaps even an application could be made to allow automatic backups to user computer at scheduled times (I'm personally doing something like this over SFTP).
- Enable the users to restore files / database, optimally somewhere in the installation of Piwigo itself, but it would be nearly as efficient if users installed Piwigo again, then installed the plugin, and then restored the files through the plugin (or perhaps both options).

Other options may come in handy with more brainstorming.
What do you guys think about the idea?

Offline

 

#2 2015-10-03 10:22:19

Daniel.k
Guest

Re: Piwigo Backup Plugin suggestion

Hi

I think it is a great idea!!
I even posted a question about that a while ago:
[Forum, topic 25830] Server backup question

Maybe it can work with Cron, to schedule backups (database, plugins, settings, etc...)?
I really hate to think i will have to install everything from scratch in case of disaster...

Daniel.

 

#3 2015-10-03 15:12:01

Eric
Former Piwigo Team
VALENCE (FR)
2005-03-25
1768

Re: Piwigo Backup Plugin suggestion

Hi,

Nice global idea but what do you mean about piwigo's important files? I guess, you have in mind the settings files? The plugins? The themes ?

For some it could be all or a part of the pictures hosted by the gallery *and* the settings files. The volume of data saved would be too large to be carried out by a scheduled task.

In case of full disaster, all files are requested for rebuilding the gallery from scratch. Especially if pictures are published by several users. A scheduled database backup is easy to do without a plugin. But files...


I am only continuing the debate on the subject. I'm not opposed!
Other CMS (i.e. : Drupal) provide plugin solutions for scheduled backups of the database and files but it is usually only reduced weight files and not pictures. But we must define what is possible and what would be less.

Offline

 

#4 2015-10-06 20:10:50

kalel
Member
www.photofree.ga
2015-09-23
20

Re: Piwigo Backup Plugin suggestion

Eric wrote:

Hi,

Nice global idea but what do you mean about piwigo's important files? I guess, you have in mind the settings files? The plugins? The themes ?

For some it could be all or a part of the pictures hosted by the gallery *and* the settings files. The volume of data saved would be too large to be carried out by a scheduled task.

In case of full disaster, all files are requested for rebuilding the gallery from scratch. Especially if pictures are published by several users. A scheduled database backup is easy to do without a plugin. But files...


I am only continuing the debate on the subject. I'm not opposed!
Other CMS (i.e. : Drupal) provide plugin solutions for scheduled backups of the database and files but it is usually only reduced weight files and not pictures. But we must define what is possible and what would be less.

I fully agree to the questions posed here. And don't worry, they don't seem like you are dismissing the idea or anything like that, but as constructive feedback. The purpose of backup is usually to have a file-safe. It could be for other reasons to (to restore small changes), but I believe the case where a backup is most valuable is in case of a server crash / data loss / data corruption of some kind.

I've personally set scheduled windows tasks on my desktop PC to backup the files (using WinSCP command line) and database (using port-forwarding of the database to my PC/localhost, and then mysqldump.exe over command line to connect to the database and backup all files). Right now, I have only a few over 50 images at my gallery so that's perfectly fine. I'm using a synchronization method in WinSCP, so only files that are different on the server are backed up to my desktop, not all files every time. Of course, this could be a problem if the server files were corrupted, and then this updated on my PC also (but I could resolve that by adding another command to the task to duplicate the synchronized folder every few days and add the date to the duplicated folder name).

But to clarify the initial idea (and I'm very open to better ideas from anyone), the plugin I imagined for Piwigo should do something similar:

- Provide a backup of database and files (including images)
- Provide a way to keep this backup safely (not on the same server as Piwigo, because in case things go wrong, the backup would be lost also), so perhaps a FTP transfer option, which with a little DNS program running in the background could be used to transfer backups to owner's PC as well as any paid FTP storage server or other web host used for the purpose, and since FTP providers are dying out slowly - at least it's getting harder to find many, maybe a Dropbox / Google Drive or similar cloud provider option that starts with free plans - so is accessible to all. In case of using cloud storage, due to privacy concerns (who owns my data, what can they do with it, etc.) it may be helpful, though optional, that the backups are made in a zip file that is password protected, before sending them to those servers - giving an additional protection of data both from any hacker attacks in the middle, or the prying eyes of the owner of any file storage server.
- Provide a way to restore this backup

By important files, I meant any file that the user would need to restore his gallery after crash. Unfortunately, this is almost all files (except the standard Piwigo installation files - all unmodified files would not need to be backed up, which would save about 6 MB, which is not much, but would be more optimal than also backing up main installation files - which is unnecessary). But even if we find it more efficient to simply backup all Piwigo files, it should still do the purpose almost as effectively.

A way to lower the time it takes to make a backup may be to use some sort of synchronization method similar to what I'm using on my desktop. Make an initial backup of all files, and then for subsequent backups, only backup those new files (images, etc.) that were not saved in the last backup, or were modified since the last backup. In theory, that should speed things up a lot. Multiple backups could still be kept by duplicating the old backup folders or files (if zipped) before a new sync is commenced.

P.S.
Regarding Cron job issues with PHP time execution limits, while I can't quote any source code at the moment, I believe there may be a way to bypass this by calling the script recurrently, until the task is finished, or something of the kind.

Last edited by kalel (2015-10-06 20:17:15)

Offline

 

#5 2015-10-16 17:42:40

Eric
Former Piwigo Team
VALENCE (FR)
2005-03-25
1768

Re: Piwigo Backup Plugin suggestion

Hi,

As I said, it's still a nice idea but a bit hard to do.

Take example on the Drupal CMS. There is a bakup and Migrate module that can do pretty much what you imagine for Piwigo.

This module works to backup database and files from one site to various destinations: email, cloud, local server folder, FTP server...

It can schedule full or partial backups of databases (with tables exclusions). And it works with both the  Drupal's Cron mode as the system's Cron.

However, it works not so good for backing up files when their cumulative size is huge. The backup execution time required to put the site in maintenance (and therefore inaccessible) during the backup operation and this generates an IO rates and, probably, Cpu overloads for not very powerful or shared servers. I guess, php time execution limits is not the main inconvenience.

If someone manages to create such an extension for Piwigo without these drawbacks, it would be great. Personally, I would not be able to. ;-)

Offline

 
  •  » Extensions
  •  » Piwigo Backup Plugin suggestion

Board footer

Powered by FluxBB

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