Skip to content
Calagopus ExtensionsBrowse

SQL Import & Export

Import, export and copy SQL databases: load a dump from an upload, a server file or pasted SQL; dump a database out as a download or a file on the server; or copy one database straight into another on the same server, existing or newly created. Classic databases and managed instances, with live progress.

by BerdiiNN Updated Sep 17, 2026
Get it · Free

Description

SQL Import & Export for Calagopus

An extension for Calagopus Panel that lets users import, export and copy the SQL databases of their game servers from the panel, without phpMyAdmin, a database client or shell access.

It adds SQL Import and SQL Export tabs to a server's Databases page, and Import SQL… / Export SQL… entries to the right-click menu of every database and managed database instance.

  • Package: com.pineriver.sqlimport
  • Panel: Calagopus 1.1.0 or newer (builds against 1.1.5, 1.2.0 and 1.2.1)
  • Engines: MySQL, MariaDB and PostgreSQL, for classic databases on a database host and for databases in agent-managed instances. MongoDB has no SQL dump, so it is not supported.
  • Languages: English and Danish

Features

Import

Load a dump into a database from any of three sources:

  • Upload a .sql or .sql.gz file from the browser.
  • Pick a file from the server's own files, such as the .sql that ships with a FiveM resource. It is streamed from the node, never copied to the panel first.
  • Paste SQL straight into the page.

gzip input is recognised by its content, not its file name. Classic databases are imported statement by statement over the database's own user. The splitter understands quoting and escapes, --, # and /* */ comments (MySQL /*! */ hints are kept), DELIMITER blocks, PostgreSQL dollar-quoting and pg_dump COPY … FROM stdin data, which goes through the COPY protocol. Managed instances hand the dump to the database agent's own import.

Options:

  • Wipe the database first. The database is recreated before the import.
  • Stop on the first error, or keep going and list the failing statements.
  • Disable foreign key checks for the session (MySQL/MariaDB).

Export

Dump a database and either download it or save it into the server's files. Downloads are streamed straight to disk by the browser, so multi-gigabyte dumps don't have to fit in the tab's memory.

Options (classic databases): schema, data, DROP … IF EXISTS before every CREATE, views/triggers/routines, a table picker, gzip, and a consistent snapshot. Managed instances use the database agent's export, with gzip and table locking.

For classic databases, the dumper lets the database format every value as a SQL literal, so binary columns, non-UTF-8 data, floats and timestamps round-trip exactly.

  • MySQL/MariaDB: DDL comes from SHOW CREATE … with the DEFINER removed, so the dump restores under a different user.
  • PostgreSQL: there is no SHOW CREATE, so DDL is rebuilt from the system catalogues: schemas, enums, sequences, tables, constraints, indexes, foreign keys, functions, views, triggers and sequence values. Partitioned tables, materialised views, table inheritance, extensions, large objects, row-level security policies, comments and grants are skipped, and the job lists what it skipped.

Copy

Copy one database straight into another on the same server, without writing the dump anywhere in between. The destination can be an existing database or a new one that the copy creates first, either on a database host or inside a managed instance. The server's database limits apply. Copies stay within one engine family: MySQL and MariaDB copy into each other, PostgreSQL only into PostgreSQL. Wiping the destination is on by default and asks for confirmation.

Jobs

Every import, export and copy runs as a background job with live progress (bytes, statements, rows, tables), a list of errors and notes, and a cancel button. The page keeps a shared history of recent jobs.

  • Up to 4 jobs run at the same time panel-wide; the rest wait in a queue.
  • Finished jobs stay in the history for 30 minutes.
  • Jobs live in the panel's memory. Restarting the panel stops running jobs and clears the history.

Installation

Installing extensions requires the Calagopus heavy image (:heavy / :nightly-heavy) or a development environment, because the panel compiles extensions when you install them. See Installing Extensions.

  1. Download com_pineriver_sqlimport.c7s.zip from the latest release.
  2. In the panel, open Admin → Extensions and drop the file into the upload area. The panel installs it, compiles it and loads it.
  3. After the build finishes, reload the page.

Alternatively, copy the .c7s.zip into the panel's extensions/ data directory (./build/extensions with the default heavy compose stack) and run docker compose restart web.

In a development environment:

panel-rs extensions add path/to/com_pineriver_sqlimport.c7s.zip
panel-rs extensions apply --profile balanced

Permissions

The extension registers its own subuser permission group, sql-import:

Permission Allows
sql-import.read Opening the pages and seeing targets and jobs.
sql-import.run Importing into a database, including wiping it first.
sql-import.export Exporting a database. This reads every row, so it gives the same access to the data as reading the tables directly.
sql-import.cancel Cancelling jobs.

For compatibility with subusers created before the group existed, each check also passes when the subuser has the core permission it corresponds to (databases.read, databases.query-raw, databases.query, database-instances.import, database-instances.export, …).

Some actions need a core permission in addition:

  • Importing from a server file needs files.read.
  • Saving an export to the server needs files.create.
  • Copying into a new database needs databases.create or database-instances.databases.

Server owners and admins have every permission.

Configuration

Admin → Extensions → SQL Import & Export sets the size cap for uploaded and pasted dumps: 2 GiB by default, adjustable from 16 MiB to 64 GiB. Uploads and pasted SQL are stored in a temporary file on the panel's disk while the import runs, and the cap protects that disk. Files picked from the server are streamed from the node and aren't capped.

Building from source

Clone the repository into the backend-extensions directory of a Calagopus development environment. The directory name must be the package identifier:

cd panel
git clone https://github.com/BerdiiNN/calagopus-sql-import-export.git backend-extensions/com_pineriver_sqlimport
panel-rs extensions resync
panel-rs extensions apply --profile dev

Run the unit tests (statement splitter, dumpers, copy rules, settings) with:

cargo test -p com_pineriver_sqlimport

Build an installable archive with:

panel-rs extensions export com.pineriver.sqlimport

The package version is set in three places that must match: Metadata.toml, Cargo.toml and frontend/package.json. The panel caches builds by version, so bump the version for every release.

Layout

Metadata.toml            package metadata (name, version, panel requirement)
Cargo.toml               backend crate
src/
  lib.rs                 extension entry point: permissions, routes, job pruner
  splitter.rs            streaming SQL statement splitter
  engine.rs              import runner (classic databases and managed instances)
  export.rs, dump/       export runner and the MySQL / PostgreSQL dumpers
  copy.rs                export piped into import
  job.rs                 in-memory job registry and worker slots
  routes/                client and admin HTTP API
  settings.rs            upload size cap
  wings_fs.rs, perms.rs, health.rs
                         helpers shared across PineRiver extensions
frontend/
  src/index.ts           registers the pages, tabs and context-menu entries
  src/pages/             SQL Import and SQL Export pages
  src/translations.ts    English strings
  public/translations/   Danish translation

health.rs reports job status to the PineRiver Extension Hub when that extension is installed. Without it, the reports are silently skipped.

License

MIT © 2026 PineRiver. You're free to use, modify and redistribute this extension, including commercially, as long as you keep the copyright notice.

Tags

All extensions
  • Node Updater
    ExtensionsFree

    Keeps Wings nodes and DB Agent hosts current: checks GitHub and calagopus.com for new Panel, Wings and DB Agent releases, compares them with what every node actually runs, notifies admins (email, Discord, webhook, in-panel) and updates nodes remotely through the Wings/DB Agent upgrade API or over SSH (Docker Compose, package manager or binary installs), with a run log per update.

    GitHub
    No ratings yet