USB OFFLINE: Ubuntu 24.04 Moodle Backup
Revision as of 04:40, 1 September 2024 by Onnowpurbo (talk | contribs)
Moodle Backup
mkdir -p /var/www/html/pustaka/backupmoodle cd /var/www/html/pustaka/backupmoodle mv moodle-database.sql.gz moodle-database-old.sql.gz mysqldump -h localhost -u moodle --password=moodle -C -Q -e --create-options moodle > moodle-database.sql gzip moodle-database.sql tar czf /var/www/html/pustaka/backupmoodle/moodlecms.tar.gz /var/www/html/moodle tar czf /var/www/html/pustaka/backupmoodle/moodledata.tar.gz /var/moodledata/ chmod -Rf 777 /var/www/html/pustaka/backupmoodle chown -Rf nobody: /var/www/html/pustaka/backupmoodle
Moodle Restore
cp /var/www/html/moodle/config.php /tmp/ cd /var/www/html/pustaka/backupmoodle/ rm -Rf /var/www/html/moodle rm -Rf /var/moodledata tar zxvf moodlecms.tar.gz mv /var/www/html/pustaka/backupmoodle/var/www/moodle/ /var/www/html/ tar zxvf moodledata.tar.gz mv /var/www/html/pustaka/backupmoodle/var/moodledata /var rm -Rf /var/www/html/pustaka/backupmoodle/var/ cp /tmp/config.php /var/www/html/moodle chown -Rf www-data: /var/www/html/moodle chown -Rf www-data: /var/moodledata & cd /var/www/html/pustaka/backupmoodle gunzip moodle-database.sql.gz mysqladmin --user=moodle --password=moodle --force drop moodle mysqladmin --user=moodle --password=moodle create moodle mysql -u moodle -pmoodle moodle < /var/www/html/pustaka/backupmoodle/moodle-database.sql service mysql stop service mysql start