A repository that can dump its database into a file, and put one back: what mmo.admin's backup, restore, migrate's snapshot and data-pull/data-push go through, whatever the database is -- MongoDB (mmo.mongodb's MongoRepository), MySQL or SQLite (mmo.pdo's PDORepository), a folder of JSON collections (JsonRepository).
interface MMO\core\interfaces\iBackupRepository
Espace de noms
MMO\core\interfaces
**Through a shell.** Both run through an [`iShell`](https://mmoframework.fr/fr/documentation/mmo.core/php/interfaces/iShell.md#ishell): this machine's by default, a server's (`SSH`) to dump or
restore the database of that server. A remote dump is written on the server ($remoteFile), then downloaded; a
restore of a local file uploads it first.
**What `$database` is.** For a database server, its name (`acme`), on the shell's machine. For a database of files
([`getBackupFiles`](https://mmoframework.fr/fr/documentation/mmo.core/php/interfaces/iBackupRepository.md#ibackuprepository-getbackupfiles) not empty), the application's root folder on the shell's machine: its files are found there
as they are here under `{root}` -- [`getBackupDatabase`](https://mmoframework.fr/fr/documentation/mmo.core/php/interfaces/iBackupRepository.md#ibackuprepository-getbackupdatabase) says what it is for this repository's own data.
$file = $repository->backup(); // this machine's database, into getBackupFolder()
$repository->restore($file, null, ['users']); // only the users, back
$dump = $repository->backup(null, $repository->getBackupDatabase('/var/www/acme/current'), $ssh, '/var/www/acme/backups/x');