Function: anonymizeBackup()
function anonymizeBackup(file, destFile): Promise<{
changed: string;
cleared: BackupIdentifier[];
file: {
name: string;
path: string;
size: number;
};
}>;
Defined in: areas/backup/anonymous.ts:191
Writes to destFile a copy of a backup file (.mbz) that names no one and no site: no browser,
no session. Every user id in its XML is 0 (files' owners, questions' creators, modifiers and
owners…), every author's or issuer's name empty; the original site's address and identifier hash,
the course's id and names, the file's name, the site's host in question stamps, the site's address
in texts and the backup's log are replaced by neutral values (ANONYMOUS). The content (texts,
settings, files) stays as it was; the numeric ids of the backup's pieces too, which only matter
inside it. Moodle restores the copy as a backup from another site, wherever it's restored: the
questions and files are the restoring person's, and links to activities left out of the backup
point to the neutral site. Returns what was cleared. destFile may be file itself. A backup with
users' data is refused: Moodle's own anonymization makes those (its anonymize setting).
Parameters
| Parameter | Type |
|---|---|
file | string |
destFile | string |
Returns
Promise<{
changed: string;
cleared: BackupIdentifier[];
file: {
name: string;
path: string;
size: number;
};
}>