Skip to content

fix: pin embedded-postgres to PG17 and add Docker-to-Desktop migration guide - #23

Open
exocode wants to merge 5 commits into
aronprins:masterfrom
exocode:fix/support-pg17-and-cross-platform-data-migration
Open

fix: pin embedded-postgres to PG17 and add Docker-to-Desktop migration guide#23
exocode wants to merge 5 commits into
aronprins:masterfrom
exocode:fix/support-pg17-and-cross-platform-data-migration

Conversation

@exocode

@exocode exocode commented Jun 10, 2026

Copy link
Copy Markdown

Problem

Paperclip Desktop currently ships with embedded-postgres 18.x (beta). The official Paperclip Docker deployment initializes PostgreSQL 17. Anyone migrating from Docker to Desktop hits two errors in sequence:

Error 1postgresql.conf locale mismatch (fixed upstream in paperclipai/paperclip#7894):

LOG:  invalid value for parameter "lc_messages": "en_US.utf8"
FATAL: configuration file contains errors

Error 2 — DB catalog LC_COLLATE incompatibility:

PostgresError: database locale is incompatible with operating system
detail: The database was initialized with LC_COLLATE "en_US.utf8",
        which is not recognized by setlocale().

Linux uses en_US.utf8, macOS uses en_US.UTF-8. PostgreSQL stores the locale at initdb time — a cluster initialized on Linux cannot be opened on macOS without migration.

Changes

scripts/prepare-server.mjs

After assembling the server bundle, downgrade embedded-postgres from 18.x to 17.10.0-beta.17 so Desktop can open existing PG17 data directories (Docker or older Desktop installs) without a manual pg_upgrade.

This is intentionally a targeted downgrade with a clear comment marking it as temporary — once @paperclipai/server ships with PG17 as the default, the block can be removed.

docs/guides/docker-to-desktop-migration.md

Step-by-step migration guide covering:

  • One-time pg_dump / pg_restore to migrate LC_COLLATE metadata
  • PAPERCLIP_HOME and config.json configuration for Desktop
  • Rollback instructions (old Docker data is preserved)
  • Alternative: keeping Docker Postgres as the backend for Desktop

Testing

Verified end-to-end on macOS arm64:

  • Docker data directory (PG17, en_US.utf8) successfully opened by Paperclip Desktop after following the migration guide
  • All agents, companies, issues and runs intact after restore
  • Desktop runs without Docker after migration

Related

…n guide

## Problem

Paperclip Desktop ships with embedded-postgres 18.x (beta), but existing
data directories created by the official Docker deployment use PostgreSQL 17.
Pointing Desktop at a Docker data directory fails with a locale incompatibility
error because Linux uses 'en_US.utf8' and macOS uses 'en_US.UTF-8'.

## Changes

### scripts/prepare-server.mjs
After assembling the server bundle, downgrade embedded-postgres from 18.x to
17.10.0-beta.17 so that Desktop can open existing PG17 data directories
(Docker or older Desktop installs) without a manual pg_upgrade.

The postgresql.conf locale normalization (lc_* parameters) is handled
upstream in paperclipai/paperclip#7894.

### docs/guides/docker-to-desktop-migration.md
Step-by-step guide covering:
- pg_dump / pg_restore for the one-time LC_COLLATE migration
- PAPERCLIP_HOME and config.json setup
- Rollback instructions
- Alternative: keeping Docker DB as backend for Desktop
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

aronprins and others added 4 commits June 18, 2026 15:10
cpSync throws EINVAL when src and dest are the same inode (hardlinks).
Compare inodes via lstatSync instead of resolving symlinks with realpathSync.

Also adds realpathSync to imports (unused but harmless, kept for clarity).
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.

2 participants