Welcome to the LimeSurvey Community Forum

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

Automatic backup

  • aukevann
  • aukevann's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 2 weeks ago #149270 by aukevann
Automatic backup was created by aukevann
Hi,

Is there a way to automate backups of both the files and especially the database?

Best regards,
Auke
The topic has been locked.
  • gabrieljenik
  • gabrieljenik's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
7 years 2 weeks ago #149284 by gabrieljenik
Replied by gabrieljenik on topic Automatic backup
Hi Aukevann,

Which files?
I could create a plugin for that if you want.

Thanks!

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Checkout our Reporting Solutions and our plugin shop at www.encuesta.biz .

The topic has been locked.
  • aukevann
  • aukevann's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 2 weeks ago #149285 by aukevann
Replied by aukevann on topic Automatic backup
backup of the whole site, inclusief SQL database
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 weeks ago #149338 by DenisChenu
Replied by DenisChenu on topic Automatic backup
For sql : more easy with mysql.

And maybe : better to do a sh script for this

I have different sheel script on my server :
- Some to do 'hard backup' of DB blog.shnoulle.net/Un-ptit-script-de-backup-mysql (in sql file)
- Some to copy DB in DB (with another name)
- Some tar backup of needed directory
Code:
#!/bin/bash

 
# Linux bin paths, change this if it can not be autodetected via which command
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
GZIP="$(which gzip)"
# Get hostname
HOST="$(hostname)"
 
# File to store current backup file
FILE=""
 
# Get all database list first , if you want to backup all DBS
# DBS="$($MYSQL -Bse 'show databases')"
# Store list of databases
DBS="limesurvey
limesurvey2
cms1
"
# Get all database list first
#DBS="$($MYSQL -Bse 'show databases')"

echo "Backup of DBs"
for db in $DBS
do
    dbnew="zzbak_last_$db"
    $MYSQLDUMP  --databases $db  > $HOME/backupsql/$db.sql
    echo "DROP DATABASE IF EXISTS ${dbnew}" | $MYSQL
    echo "CREATE DATABASE ${dbnew}"  | $MYSQL
    $MYSQL $dbnew < $HOME/backupsql/$db.sql
done

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose