Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6619

Re: *correction* - Re: Restore with only moodle, moodledata, \var\lib\mysql, and \etc\mysql

$
0
0
by Ken Task.  

Congrats!  Know that it's been an 'unpleasant' learning experience but you've internalized much in a short time and learned the most important lesson of backing up Moodle the easiest way.

From mysql docs:

If you change a global system variable, the value is remembered and used for new connections until the server restarts. (To make a global system variable setting permanent, you should set it in an option file.)

Now might I offer little bash shell scripts to facilitate backups in parts?   I have 3 that backs up code, the data directory, and the DB.   Must manually create the backup directory.  I usually use /home/backup/

As root user:

cd /usr/local/bin/

nano [nameofscript]

echo 'backupcode';
tar -cvf /home/backup/moodlecode-$(date +%Y%m%d).tar /var/www/html/moodle;
ls -l /home/backup/moodlecode*

echo 'backupdata';
tar -cvf /home/backup/moodledata-$(date +%Y%m%d).tar /var/www/moodledata;
ls -l /home/backup/moodledata*

echo 'backupdb';
mysqldump -u root -p[password] moodle > moodledb-$(date +%Y%m%d).sql;
ls -l /home/backup/moodledb*;

To do it all now, from any location, as root user, issue:

backupcode; backupdata; backupdb

If updating, upgrading or installing plugins just run:

backupcode;backupdb

'spirit of sharing', Ken



Viewing all articles
Browse latest Browse all 6619

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>