MMOframework
Pourquoi l'IA Playground Bibliothèques Développeurs Agence
FR EN
Créer un projet en direct
Index
# Backups: encrypted, off site, restored on test What mmo.admin does for ISO/IEC 27001:2022 A.8.13 (backup) and A.5.30 (continuity), and the policy proposed for a project to adopt. The policy itself is the project's decision: nothing here is switched on by default. ## What the code does - **Every database the application has**, through its repository (mmo.core's `iBackupRepository`): MongoDB (`mongodump`/`mongorestore`, mmo.mongodb), MySQL (`mysqldump`/`mysql`, mmo.pdo: here the handler's credentials in a file of options, mode 0600, removed after; on a server its user's own `~/.my.cnf`), SQLite (mmo.pdo: a consistent copy by `sqlite3 .backup`, the file restored whole), JSON collections (mmo.core's `JsonRepository`: a `.tar.gz` of its files by their path from the application's root, restored collection by collection, each file moved into place). The controller's `repository`, then its `repositories` (`[{"$": "#metricsRepository"}]`): `backup` dumps each, `restore` takes the one its dump is of (`-json.tar.gz`, `-sqlite.tar.gz`, `.sql.gz`, `.mongo`). A database server is the target's `database`; a database of files is where its live release has it, `{folder}/current`. A snapshot taken before a restore or a migration is named after the target (`{target}-{date}-...`), so a dump made here the same second is never overwritten by it. - **A backup set**: what one `backup` makes of a site, every part in its `backups/` named after the site and one time (`BackupSets`): each database's dump (`{site}-{Ymd-His}-{database}.mongo`...), its shared files (`{site}-{Ymd-His}-files.tar.gz`: its shared paths but its configuration -- data, uploads, keys, metrics, section types; `SiteBackupTask`) and its configuration (`{site}-{Ymd-His}-config.tar.gz`: `shared/configs`, its secrets, readable by its owner only). `--parts=databases,files,config` takes some, all three by default. The configuration leaves the server encrypted, or not at all: without `backup.encrypt` it is neither copied off site nor downloaded. - **`restore --set=