moodle-local_datacleaner
moodle-local_datacleaner copied to clipboard
Create site backup, restore, refresh and clean commands inside this plugin
- [ ] There are lots of ways to backup and restore a db, it would be good at collect best practice around this and put it inside this and under source control.
- [ ] it needs to the same regardless of db, so the same script should detect the dbtype in config.php and do whatever it should. Ideally we should do this in php land using
define('ABORT_AFTER_CONFIG', true);instead of trying to parse the php file. There is a crusty bash script here which does this in a poor mans way: - [ ] it should be smart and auto detect all the db stuff from config.php when creating the backup, and likewise when restoring a back. ie you should be able to have a different db name in a new instance and it will just do what it's supposed to.
- [ ] unlike the script below it should make as few assumptions around the environment as possible, ie not assume it has sudo, not assume the postgres user is called something in particular
https://github.com/brendanheywood/scripts/blob/master/mdl-backup