Difference between revisions of "Moodle: Backup Site"

From OnnoWiki
Jump to navigation Jump to search
Line 14: Line 14:
  
 
* Buat site moodle seperti biasa
 
* Buat site moodle seperti biasa
 +
* Selamatkan file config.php, misalkan ke /tmp/config.php atau ~/config.php
 
* Setup database
 
* Setup database
 
* Restore, misalnya,
 
* Restore, misalnya,
Line 27: Line 28:
 
Contoh script untuk men-download dari cyberlearning.web.id
 
Contoh script untuk men-download dari cyberlearning.web.id
  
  wget http://182.48.189.103/pustaka/backupmoodle/moodle-database.sql.gz -O /var/data/library/backupmoodle/moodle-database.sql.gz
+
  wget http://cyberlearning.web.id/pustaka/backupmoodle/moodle-database-old.sql.gz -O /var/www/html/pustaka/backupmoodle/moodle-database-old.sql.gz
  wget http://182.48.189.103/pustaka/backupmoodle/moodlecms.tar.gz -O /var/data/library/backupmoodle/moodlecms.tar.gz
+
wget http://cyberlearning.web.id/pustaka/backupmoodle/moodle-database.sql.gz -O /var/www/html/pustaka/backupmoodle/moodle-database.sql.gz
 +
  wget http://cyberlearning.web.id/pustaka/backupmoodle/moodlecms.tar.gz -O /var/www/html/pustaka/backupmoodle/moodlecms.tar.gz
 +
chmod -Rf 777 /var/www/html/pustaka/backup*
 +
chown -Rf nobody.nogroup /var/www/html/pustaka/backup*
  
  
 +
==Restore Cyberlearning==
  
  

Revision as of 05:32, 5 April 2016

Sumber: https://docs.moodle.org/23/en/Site_backup


Script

mv moodle-database.sql.gz moodle-database-old.sql.gz
mysqldump -h namamesin -u usernamemoodle --password=passwordmoodle -C -Q -e --create-options databasemoodle > moodle-database.sql
gzip moodle-database.sql
tar czf /var/www/pustaka/backupmoodle/moodlecms.tar.gz /var/www/moodle


Restore

  • Buat site moodle seperti biasa
  • Selamatkan file config.php, misalkan ke /tmp/config.php atau ~/config.php
  • Setup database
  • Restore, misalnya,
mysql -p new_database < moodlesqlfile.sql

atau

mysql -u root -ppassword databasemoodleyangbaru < moodle-database.sql

Download Data dari Cyberlearning.web.id

Contoh script untuk men-download dari cyberlearning.web.id

wget http://cyberlearning.web.id/pustaka/backupmoodle/moodle-database-old.sql.gz -O /var/www/html/pustaka/backupmoodle/moodle-database-old.sql.gz
wget http://cyberlearning.web.id/pustaka/backupmoodle/moodle-database.sql.gz -O /var/www/html/pustaka/backupmoodle/moodle-database.sql.gz
wget http://cyberlearning.web.id/pustaka/backupmoodle/moodlecms.tar.gz -O /var/www/html/pustaka/backupmoodle/moodlecms.tar.gz
chmod -Rf 777 /var/www/html/pustaka/backup*
chown -Rf nobody.nogroup /var/www/html/pustaka/backup*


Restore Cyberlearning

Referensi