Difference between revisions of "Moodle: Backup Site"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 52: | Line 52: | ||
cp /tmp/config.php /var/www/html/moodle | cp /tmp/config.php /var/www/html/moodle | ||
chown -Rf www-data.www-data /var/www/html/moodle | chown -Rf www-data.www-data /var/www/html/moodle | ||
+ | cd /var/www/html/pustaka/backupmoodle | ||
+ | gunzip moodle-database.sql.gz | ||
mysqladmin --user=root --password=OCenterID --force drop moodleOC | mysqladmin --user=root --password=OCenterID --force drop moodleOC | ||
mysqladmin --user=root --password=OCenterID create moodleOC | mysqladmin --user=root --password=OCenterID create moodleOC | ||
− | mysql -u root -pOCenterID moodleOC < / | + | mysql -u root -pOCenterID moodleOC < /var/www/html/pustaka/backupmoodle/moodle-database.sql |
+ | service mysql stop | ||
+ | service mysql start | ||
+ | |||
==Referensi== | ==Referensi== |
Revision as of 05:46, 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
- Pastikan anda sudah menginstalasi moodle kosong.
- Selamatkan config.php ke /tmp/config.php atau ~/config.php
- Misalkan lokasi moodle adalah
/var/www/html/moodle/
Restore
cd /var/www/html/pustaka/backupmoodle/ rm -Rf /var/www/html/moodle tar zxvf moodlecms.tar.gz mv /var/www/html/pustaka/backupmoodle/var/www/moodle/ /var/www/html/ rm -Rf /var/www/html/pustaka/backupmoodle/var/ cp /tmp/config.php /var/www/html/moodle chown -Rf www-data.www-data /var/www/html/moodle cd /var/www/html/pustaka/backupmoodle gunzip moodle-database.sql.gz mysqladmin --user=root --password=OCenterID --force drop moodleOC mysqladmin --user=root --password=OCenterID create moodleOC mysql -u root -pOCenterID moodleOC < /var/www/html/pustaka/backupmoodle/moodle-database.sql service mysql stop service mysql start