Skip to content

Migrating from Pelican (Dockerized)

This guide is for Pelican installs running in Docker. If you have a docker-compose.yml with a Pelican service, you're in the right place. If Pelican runs directly on the host without containers, use the Standalone guide instead.

The import works the same way regardless of how Pelican is running: you point the Calagopus importer at a .env file with Pelican's database connection details, and it reads everything across. The Docker-specific part is that you may have to build that .env file yourself, since database hostnames inside Docker networks don't match what's in Pelican's original .env.

API keys do not migrate. The hashes aren't compatible, and neither is the API, so old keys wouldn't work even if they were imported. See the intro for the full reasoning.

Prerequisites

Before you start, you'll want:

  • Access to your Dockerized Pelican install (the directory with the compose file and .env).
  • Calagopus Panel installed but not yet configured. Stop at the Out-of-Box Experience (OOBE) screen.

Install Calagopus First

If you haven't installed Calagopus yet, follow the installation guide. Once you reach the OOBE screen, stop. Don't click through it, don't create the admin user. Just leave it there and come back here.

Don't click through the OOBE

The importer needs an empty Calagopus database to write into. The OOBE creates initial records (admin user, default settings) that would conflict with what the importer is trying to do.

Calagopus Panel OOBE

Already clicked through? Here's how to undo it

You'll need to drop and recreate the database. Pick the tab that matches how Calagopus is installed:

Go to the directory with your Calagopus compose file and stop the stack:

bash
docker compose down

Delete the Postgres data directory:

bash
# This wipes the Calagopus database. Don't run this if you have data you care about.
rm -r postgres

Start Calagopus back up:

bash
docker compose up -d

Set the Pelican Directory

Most commands below reference your Pelican install directory. Set it as a shell variable up front to save typing. If your Pelican host mount is at /srv/pelican, this is fine as-is, otherwise change the path:

bash
export PELICAN_DIRECTORY=/srv/pelican

This is optional, you can substitute the path inline anywhere you see $PELICAN_DIRECTORY. It just makes the commands shorter.

Choose Your Calagopus Install Method

The exact commands depend on how Calagopus itself is installed. Pick the matching tab:

Building the Pelican .env File

Pelican's database is reachable from inside the Pelican containers, but likely not from your Calagopus containers, since different Docker networks use different hostnames. The fix is to build a small pelican.env file with database connection details that work from where the importer runs.

The importer needs APP_URL, APP_KEY, and the database settings. Pelican supports these database drivers:

  • mysql
  • mariadb
  • sqlite
  • sqlite3
  • pgsql
  • postgres
  • postgresql

You'll find the values in Pelican's .env file. Assemble them into a new file in a moment.

APP_URL

Your existing Pelican domain. Look for it in Pelican's docker-compose.yml or .env:

sh
APP_URL=https://panel.example.com

APP_KEY

Find this in Pelican's .env:

bash
cat $PELICAN_DIRECTORY/.env | grep APP_KEY

Copy the value. It looks like:

sh
APP_KEY=base64:xc5QXq4u3Qgi3zRP0Q9qq32mnZvl0lVY

DB_CONNECTION

Check Pelican's .env for the value. Common values are mysql, mariadb, or sqlite:

sh
DB_CONNECTION=mysql

MySQL / MariaDB / PostgreSQL Database Settings

If DB_CONNECTION is mysql, mariadb, pgsql, postgres, or postgresql, you also need:

  • DB_HOST
  • DB_PORT
  • DB_DATABASE
  • DB_USERNAME
  • DB_PASSWORD

Most of these come straight from Pelican's .env, but DB_HOST is tricky. Pelican's .env probably has something like DB_HOST=database, a Docker service name that won't resolve from outside that compose stack. Get the actual container IP instead:

bash
# Linux/MacOS - run from inside the Pelican directory
echo "DB_HOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker compose ps -q database))"

# Windows
echo "DB_HOST=$($(docker compose ps -q database) | foreach { docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $_ })"

A finished MySQL/MariaDB block looks like:

sh
DB_CONNECTION=mysql
DB_HOST=172.29.0.4
DB_PORT=3306
DB_DATABASE=pelican
DB_USERNAME=pelican
DB_PASSWORD=secret

SQLite3 Database Settings

If DB_CONNECTION is sqlite or sqlite3, you only need DB_DATABASE:

sh
DB_CONNECTION=sqlite
DB_DATABASE=/database.sqlite

The path matters. /database.sqlite is where the SQLite file will sit inside the Calagopus container. If Pelican's original .env has a relative path like database/database.sqlite, override it with this absolute in-container path.

Assembling the File

Go to the Calagopus directory (where your compose.yml lives) and create a file called pelican.env with everything you collected:

sh
APP_URL=https://panel.example.com
APP_KEY=base64:xc5QXq4u3Qgi3zRP0Q9qq32mnZvl0lVY
DB_CONNECTION=mysql
DB_HOST=172.29.0.4
DB_PORT=3306
DB_DATABASE=pelican
DB_USERNAME=pelican
DB_PASSWORD=secret

Running the Import

Copy the pelican.env you just made into the Calagopus container:

bash
docker compose cp pelican.env web:/.env

If you're on SQLite3, also copy the database file in:

bash
docker compose cp $PELICAN_DIRECTORY/database/database.sqlite web:/database.sqlite

Run the importer:

bash
docker compose exec web calagopus-panel import pelican --environment /.env

This walks through users, servers, nodes, allocations, eggs, and everything else. Small installs finish in seconds, larger ones take longer. Progress is logged to stdout.

If the import errors out

Treat the database as poisoned. A partial import leaves Calagopus in an inconsistent state. Drop the Postgres data (steps in the OOBE warning above), let Calagopus recreate it empty, and re-run the import.

When the import finishes, restart the stack:

bash
docker compose down
docker compose up -d

Log in with your existing Pelican credentials.

What's Next

Wings also needs to point at the new panel. See Updating Wings for that step.

After migrating, regenerate any API keys used by external scripts. The old Pelican keys won't work, and the Calagopus API differs from Pelican's, so those integrations need updating regardless.