Files
Andras Bacsai 8b007edceb fix(database): skip MySQL system databases when restoring all databases
An all-databases MySQL/MariaDB restore also restored the mysql system
database, so after the next restart the root and app passwords were the
source ones and the MariaDB health check failed. The restore now skips mysql,
sys, performance_schema and information_schema by default. The new option
"Restore users and privileges" (restore_mysql_users in the API) keeps the
old behaviour.
2026-09-30 18:59:49 +02:00

25 lines
697 B
PHP

<?php
namespace App\Support\DatabaseImport;
use InvalidArgumentException;
readonly class DatabaseImportSource
{
public function __construct(
public string $type,
public ?string $uploadId = null,
public ?string $path = null,
public ?string $s3StorageUuid = null,
public bool $dumpAll = false,
public bool $replaceExisting = false,
public bool $keepOwners = false,
public ?string $sqliteDatabase = null,
public bool $restoreMysqlUsers = false,
) {
if (! in_array($type, ['upload', 's3', 'server'], true)) {
throw new InvalidArgumentException('Invalid database import source.');
}
}
}