Paperclip Backup and Migration
A Paperclip company is more than a database. It has agents' working directories, uploaded files and an encryption key, and a backup that misses any one of them restores less than you expect. This guide maps where everything lives, shows the backups Paperclip already makes for you, and gives the order for moving a company from a laptop to a server.
Step 1: Know what lives where
| Where | What |
|---|---|
| PostgreSQL | Companies, the org chart, agents, goals, projects, tasks and their conversations, run history, costs and budgets, approvals, the activity log, and stored secrets (encrypted) |
The data folder (/paperclip in Docker) | Agent workspaces, uploaded attachments, run logs, the local secrets key file if one is used, and Paperclip's own database backups |
| The environment | The session secret, the tool-action signing secret, and the master key when it is set as PAPERCLIP_SECRETS_MASTER_KEY |
The master key and the database belong together. Paperclip's documentation puts it plainly: a database backup without the key cannot decrypt local secrets, and a key without the database is not enough either.
Step 2: Keep Paperclip's database backups on
Paperclip makes logical database backups on its own. Unless you turn them off, it writes one every 60 minutes by default, as a gzipped SQL file named like paperclip-<timestamp>.sql.gz, into instances/default/data/backups under its data folder. The backups cover Paperclip's database schemas, including the migration history and plugin schemas. Retention can be set in the instance's general settings, and the environment variables PAPERCLIP_DB_BACKUP_ENABLED, PAPERCLIP_DB_BACKUP_INTERVAL_MINUTES and PAPERCLIP_DB_BACKUP_DIR change the defaults. On a self-built install, paperclipai db:backup takes one on demand.
Because these files are plain SQL, a standard psql can replay one into an empty database. If you run your own PostgreSQL, a regular pg_dump of the Paperclip database works as well, and keeps your backups independent of the application.
A backup that stays on the same server protects you from mistakes, not from losing the server. Copy backups somewhere else on a schedule.
Step 3: Save the files and the key with them
Database backups do not include uploads, workspaces or the secrets key. For a full recovery, back up the data folder and keep the master key with it.
On Hosting for Paperclip:
- The database runs as a PostgreSQL 15 cluster on all three of your instances with automatic failover, so a lost server does not lose it. Replication is not a backup against a mistake, though, which is what Paperclip's hourly backups are for.
- The panel's Backup tab copies Paperclip's files, the
/paperclipfolder, on demand. Because Paperclip writes its database backups into that folder, the copy carries recent database backups too. The live database itself is not copied as files, since a file copy of a running PostgreSQL is not a reliable backup. - The master key and the other secrets are generated at deploy and kept in your app's encrypted specification, and they stay the same through updates.
Step 4: Move a company with export and import
Most people try Paperclip on a laptop first. The laptop install uses an embedded PostgreSQL in local mode with no login, and its secrets are encrypted with a key file on that laptop. A server uses a different database, a different key and real accounts. The clean way across is Paperclip's company portability:
- Export on the laptop. In the app, open the company settings and choose Export, or run
paperclipai company export <company-id> --out ./my-export --include company,agents,projects,tasks,skills. The export page shows a "Not included in this export" list before you download. - Set up the server and create the owner account there.
- Import on the server from the company settings. Paperclip previews the package, lets you resolve name collisions and adapter assignments, and by default brings agents and routines in paused.
- Reconnect models. Secret values are never exported, so add your API keys or connect your subscription on the server, as in connecting AI models.
- Activate the imported agents and routines you want running.
Be clear about what may not come across: the export lists what it leaves out, which can include attachments, approvals, cost history and activity log entries. Keep the laptop install until you have checked the server.
A full database move, with every run and message, is possible for self-hosters with your own PostgreSQL: take a backup, replay it into the new database, and bring the master key, or the stored secrets will not decrypt. Hosting for Paperclip has no database import tool in the panel, so for a move to our servers the company export is the supported path.
Moving away later
Nothing locks a company in. Export stays available on any instance, and the package is markdown-based, so you can take your company to another Paperclip server whenever you like.
Bring your company to an always-on server with Hosting for Paperclip on Flux, or read why agents belong on one.
Frequently Asked Questions
Does Paperclip back up its own database?
Yes. Unless turned off, Paperclip writes logical database backups on a timer, every 60 minutes by default, as gzipped SQL files in its data folder. Retention can be set in the instance settings.
Is a database backup enough to restore everything?
No. Paperclip’s docs say database backups do not include uploads, workspace files or the local secrets key. Back those up separately for a full recovery.
Does the panel’s Backup tab include the database?
No. It copies Paperclip’s files, which include Paperclip’s own database backups. The live database is not copied as files, because a file copy of a running PostgreSQL is not a reliable backup; the cluster replicates it across three nodes instead.
What does a company export include?
Company details, agents with their roles, reporting lines and instructions, and optionally projects, tasks, skills and routines. Secret values, machine-local paths and database IDs are never exported, and the export page lists anything else it leaves out before you download.
Will my API keys come across in a migration?
Not in an export, by design. Enter them again on the new server, or connect your subscription there. The new server encrypts them with its own key.
Paperclip is open-source software (MIT) by the Paperclip project (https://github.com/paperclipai/paperclip). Flux is not affiliated with or endorsed by the Paperclip project.