Difference between revisions of "USB OFFLINE: Ubuntu 24.04 Moodle Backup"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 13: | Line 13: | ||
Moodle Restore | Moodle Restore | ||
− | cp /var/www/html/moodle/config.php | + | cp /var/www/html/moodle/config.php /tmp/ |
cd /var/www/html/pustaka/backupmoodle/ | cd /var/www/html/pustaka/backupmoodle/ | ||
rm -Rf /var/www/html/moodle | rm -Rf /var/www/html/moodle |
Revision as of 04:40, 1 September 2024
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