MOODLE – Backup and restore DB Orders

Export DB DUMP with ignore table mdl_logstore_standard_log

mysqldump moodle --ignore-table=mdl_logstore_standard_log | gzip > /backup/moodledb-date +\%Y-\%m-\%d-\%H-\%M-\%S.sql.gz 

Import DB DUMP

gunzip < moodledb_dump.sql.gz | mysql -u moodle -p moodle

import DB dump without log table

gzip -cd "./mydb.sql.gz" | sed -r '/INSERT INTO `(log_table_1|log_table_2|log_table_3|log_table_4)`/d' | gzip > "./mydb2.sql.gz"

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.