Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Automatic backup of all surveys - easiest way

  • Matiasko
  • Matiasko's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 4 weeks ago #165849 by Matiasko
Hello!

As the topic states - I was asked to work out a way of automatic backup of all surveys in our database. I see some ways of achieving this. My goal is to make it easy to implement, but I might not see some flows of these ideas.

First of all, I distinguish two cases of 'backup all surveys':
  1. Backup of SQL database file (manually:Configuration > Backup entire database)
  2. Backup of all .lsa files (manually: Select all surveys in menu > Selected surveys > Export as... Survey archive (*.lsa))

Of course, the first case is more suitable for future full restoration of all surveys (in case of a big crash) because we would simply need to create a database from SQL file. However, sometimes we would need to bring back just one survey, then, the second case is better. Of course best if both are made at the same time.

Ok, so to the possibilities we go:
  1. Do it manually. You could say 'Hey friend, just click here, click there and it's done' and I would completely agree. However, I once tried to do something similar (run script once a week) and most of the time I forgot about it or had way more important tasks and meetings to attend. So as long as there is an option to auto-generate this backup I want to use it.
  2. Use one already created script. I found a quite similar topic in which user Mazi pointed out that "cron job script to automatically create database backups for Limesurvey is available at the Limesurvey Template Shop" but I couldn't find it there.
  3. Create SQL dump cron job to execute e.x. once a week .
  4. Use crawler-like script (e.x. R, Python using Selenium) to: enter login page > log in > "click" through options as if done manually. Sure fun to implement but not close to simple in my opinion.
  5. Use LimeSurvey API. I worked with this remote control API recently but I guess exporting survey is not available yet. At least I couldn't find such method here but was able to find this page and method (however this must be not implemented yet or I can't use it properly).

Are there any other, simpler methods to achieve this? Do the above methods have any bigger flows?

Of course, the backup file (1st case) or folder (2nd case) should be easy to name the way we would want it like "YYYY.MM.DD_backup"

LimeSurvey version: 3.3.1

I already gained so much support thanks to this community, so I'm looking forward to your ideas :)

Best regards

Mateusz
The topic has been locked.
More
6 years 4 weeks ago #165876 by jelo

Matiasko wrote: Are there any other, simpler methods to achieve this? Do the above methods have any bigger flows?


Backup LimeSurvey like any other web-application (in your organisation), which isn't offering internal backup/export routines. Surveywise backups via crawler-like script sound not that reliable. Timeouts and changes in the application might prevent backups too often. You might be better off, developing or sponsoring a new plugin or script.

A job/task feature, where you could do exports/backup to certain destinations (FTPS/SFTP/S3/WebDav etc.) would be nice. Combined with a commandline control program (like e.g. Nextcloud is offering with occ
docs.nextcloud.com/server/13/admin_manua...ver/occ_command.html ) would be Gold.
But that is not the case at the moment.

For a POSIX environment a typical, simple backup will be done via cron. Dump databases. Backup database dump and flatfiles into a archive. Move archive somewhere else. There are better tools which backup every x minutes and sync databases all the time. But that is a budget thing. How much value is in the LimeSurvey installation. Push or pull backup? Or a combination, to prevent that a hacker can access and erase the backup repository.

Would be interesting to know how LimeSurvey GmbH is doing backups for their LimeSurvey Pro hosting plans.
The only information I found was in the TOS:

The customer is obliged to back-up data independently at all times. The provider creates a voluntary precautionary data back-up every 24 hours in general.

Perhaps some customers of LimeSurvey Pro can tell us how they do external backups.

The export of certain surveys or raw sql data seems to be seldom the topic. Many are searching for exporting responses (which isn't allowing a restore of the Survey). One of the oldest threads about this topic is this.
www.limesurvey.org/forum/can-i-do-this-w...limesurvey-responses

You might open a feature request about extending the remote control api or other features around backup and restore.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose