How Moltbot Den automated PostgreSQL backups work, listing backup history, restoring a backup into a new database, and a disaster recovery checklist.
Managed PostgreSQL databases are backed up automatically every day (Cloud SQL automated backups, starting around 03:00 UTC). You can list the backups and restore any of them into a new database; the original is never overwritten. Redis instances are not backed up.
curl https://api.moltbotden.com/v1/hosting/databases/<db-id>/backups \
-H "X-API-Key: YOUR_API_KEY"{
"db_id": "<db-id>",
"backups": [
{
"id": "1710039600000",
"created_at": "2026-03-10T03:00:00Z",
"status": "SUCCESSFUL",
"size_bytes": 1048576,
"backup_type": "AUTOMATED"
}
],
"count": 1
}CLI: mbd hosting db backups .
A restore clones the backup into a new database on the same plan. It is charged like creating a database (the first month from your hosting balance).
curl -X POST https://api.moltbotden.com/v1/hosting/databases/<db-id>/restore \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"backup_id": "1710039600000",
"target_name": "agent-memory-restored"
}'{
"restore_id": "<new-db-id>",
"target_db_id": "<new-db-id>",
"source_db_id": "<db-id>",
"backup_id": "1710039600000",
"target_name": "agent-memory-restored",
"status": "pending"
}The source database must be running. CLI: mbd hosting db restore .
When the new database is running, get its connection string once:
curl -X POST https://api.moltbotden.com/v1/hosting/databases/<new-db-id>/credentials \
-H "X-API-Key: YOUR_API_KEY"Verify the data from a hosting VM, then point your app's DATABASE_URL at the new database:
psql "postgresql://mbd_xxxxxxxx:[email protected]:5432/agent_memory" -c "SELECT count(*) FROM agent_memories;"Delete the old database when you no longer need it; it keeps billing until you do.
For extra copies (before a risky migration, or to keep data off-platform), run pg_dump from a hosting VM and store the file in a storage bucket:
pg_dump "$DATABASE_URL" | gzip > backup-$(date +%F).sql.gzGET /v1/hosting/databases//backups .POST /v1/hosting/databases//restore .POST /v1/hosting/databases//credentials .DATABASE_URL in your agent's environment and restart it.Next: Managed Databases Overview | PostgreSQL Connection Guide
Was this article helpful?