Server Migration: real analysis and a real modular copy

The page was a mock: it never read the database (always 0 accounts),
showed a hard-coded schema and core version, looked for server files in
the wrong folder, and its "transfer" reported accounts, characters and
tables as moved without moving anything. Its locale was fixed to "ru".

- remove server_migration.rs and its three commands
- modular_copy::preview: classic/modular core, version, database state,
  counts and schemas from a running database (read only), database size,
  settings files, extra worlds; nothing is started or changed
- the page shows that and hands over to the same modular-copy install
  screen as "Manage another server"; texts in en and ru via i18n
- the modular copy now carries world settings changed in Server
  Configuration (Settings/worldserver.conf.template was not copied)
- E2E preview_bare_and_copy_e2e checks the preview and the carried
  setting; passes against preview core 0.261108.9501

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ДмитрийandClaude Opus 5.5 committed 2026-11-11 09:22:22 +05:00
1 parent 6091e545f8
commit fdbf38ee4e
14 files changed
+495 -1260

No files matched your search

+3 -39
View File
@@ -3374,42 +3374,8 @@ async fn preview_export_diagnostics(
}
#[tauri::command]
async fn preview_migration_inspect(
source_path: String,
) -> std::result::Result<coa_core::server_migration::SourceInspectionReport, UiError> {
blocking(move || {
let p = std::path::PathBuf::from(source_path);
coa_core::server_migration::inspect_source(&p).map_err(Into::into)
})
.await
}
#[tauri::command]
async fn preview_migration_plan(
state: State<'_, AppState>,
source_path: String,
dest_realm_id: String,
scope: coa_core::server_migration::MigrationScope,
conflict_policy: coa_core::server_migration::ConflictResolutionPolicy,
) -> std::result::Result<coa_core::server_migration::MigrationPlan, UiError> {
let dest_root = path_of(&state, &dest_realm_id)?;
blocking(move || {
let src_p = std::path::PathBuf::from(source_path);
let report = coa_core::server_migration::inspect_source(&src_p)?;
coa_core::server_migration::plan_migration(&report, &dest_root, scope, conflict_policy)
.map_err(Into::into)
})
.await
}
#[tauri::command]
async fn preview_migration_execute(
plan: coa_core::server_migration::MigrationPlan,
) -> std::result::Result<coa_core::server_migration::MigrationExecutionReport, UiError> {
blocking(move || {
coa_core::server_migration::execute_migration(&plan).map_err(Into::into)
})
.await
async fn modular_copy_preview(path: String) -> std::result::Result<coa_core::modular_copy::CopyPreview, UiError> {
blocking(move || coa_core::modular_copy::preview(Path::new(&path)).map_err(Into::into)).await
}
#[tauri::command]
@@ -3576,9 +3542,7 @@ pub fn run() {
preview_remove_module,
preview_list_installed_plugins,
preview_export_diagnostics,
preview_migration_inspect,
preview_migration_plan,
preview_migration_execute,
modular_copy_preview,
preview_check_updates,
default_install_dir,
game_data_folder,