Skip to content

Add Export/Import backup functionality to the admin panel Setup page#715

Draft
sven-n with Copilot wants to merge 8 commits into
masterfrom
copilot/add-backup-restore-functionality
Draft

Add Export/Import backup functionality to the admin panel Setup page#715
sven-n with Copilot wants to merge 8 commits into
masterfrom
copilot/add-backup-restore-functionality

Conversation

Copilot AI commented Mar 20, 2026

Copy link
Copy Markdown
Contributor
  • Create IBackupService interface in src/Persistence/
  • Create BackupService in src/Persistence/ — no EF dependencies, uses IPersistenceContextProvider.CreateNewContext() and IContext.GetAsync<T>() via the repository pattern
  • Update InMemoryBackupService to extend BackupService (inherits export) and only override RestoreBackupAsync
  • Delete src/Persistence/EntityFramework/BackupService.cs
  • Register backup services in DI (Startup/Program.cs and Dapr/Common/Extensions.cs)
  • Create BackupController API controller in src/Web/AdminPanel/API/
  • Update Setup.razor and Setup.razor.cs for Export/Import UI
  • Add resource strings to Resources.resx and Resources.Designer.cs
  • Fix build errors: disambiguate type references, add missing using directives, fix ambiguous InputFile component
  • IConvertibleTo<BasicModel.ChatServerDefinition> and IConvertibleTo<BasicModel.GameServerDefinition> in ExtendedTypes.Custom.cs
  • Add LocalizedStringJsonConverter to JsonObjectSerializer and JsonObjectDeserializer options to fix runtime export error
  • Add IElement member ignore rule to MapsterConfigurator to prevent Mapster compile exception during export
  • Fix import NotSupportedException: copy BrowserFileStream to MemoryStream (pre-sized with file.Size) before passing to RestoreBackupAsync, since ZipArchive uses synchronous reads internally
  • Show Bootstrap spinner during import to give clear visual feedback while the operation runs
  • Merge master: resolved Resources.resx conflict by keeping backup resource strings from PR and new strings (Character, StartedAt, ActiveOfflinePlayer, CouldNotFindToDelete, DeleteFailedReferenced) from master
Original prompt

This section details on the original issue you should resolve

<issue_title>Backup/Restore over the admin panel</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.
For backup and debugging purposes it would be nice to have a simple way to backup and restore the configuration and selected accounts. Not only GameConfiguration needs to be considered, but all other configuration types (not in its composition root), too.

Describe the solution you'd like
The admin panel could get a Export and Import functionality on the Setup page of the admin panel. As data format, we could use jsons in zip archive, since we have a stable json serializer for that which supports circular references and other nasty stuff. The single configuration files and account files could be packed into one zip archive.

See also JsonDownloadController.
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backup/Restore over the admin panel

2 participants