-
-
Notifications
You must be signed in to change notification settings - Fork 39
How to Upgrade
Upgrading is just pulling the latest code and redeploying. No new environment variables needed (unless the release notes say otherwise).
Not sure? Here’s how to tell:
- One-click deploy – You clicked a “Deploy to Cloudflare” button in the README to get started
- Manual deploy – You cloned or forked the repo yourself and ran commands in a terminal
Step 1: Go to your repo on GitHub
It will be at github.com/YOUR-USERNAME/second-brain-cloudflare (whatever name you gave it during setup).
Step 2: Sync with the latest version
- On your repo’s main page, look for the “Sync fork” button (it appears when your copy is behind the original)
- Click it, then click “Update branch”
Step 3: Run database migrations
Some versions add new columns to the database. Run these in the Cloudflare D1 console to make sure your database is up to date:
- Go to Workers & Pages in the left sidebar
- Click D1 in the left sidebar
- Select your second-brain database
- Click the Console tab and run each of the following, one at a time (ignore “duplicate column” errors – that just means you already have it):
ALTER TABLE entries ADD COLUMN vector_ids TEXT NOT NULL DEFAULT '[]';
ALTER TABLE entries ADD COLUMN recall_count INTEGER DEFAULT 0;
ALTER TABLE entries ADD COLUMN importance_score INTEGER DEFAULT 0;Step 4: Verify the deployment
- Go to Workers & Pages in the left sidebar
- Click on your Worker
- Check the Deployments tab – you should see a new deployment at the top with a recent timestamp
If the deployment shows an error, check the build logs on that same page for details.
Step 1: Pull the latest changes
git pull upstream mainIf you haven’t set up the upstream remote yet, run this first:
git remote add upstream https://github.com/rahilp/second-brain-cloudflare.gitThen retry the git pull command above.
Step 2: Install dependencies
npm installStep 3: Run database migrations
Some versions add new columns to the database. Run these via Wrangler to make sure your database is up to date (ignore “duplicate column” errors – that just means you already have it):
npx wrangler d1 execute second-brain --command "ALTER TABLE entries ADD COLUMN vector_ids TEXT NOT NULL DEFAULT '[]'"
npx wrangler d1 execute second-brain --command "ALTER TABLE entries ADD COLUMN recall_count INTEGER DEFAULT 0"
npx wrangler d1 execute second-brain --command "ALTER TABLE entries ADD COLUMN importance_score INTEGER DEFAULT 0"Replace second-brain with your actual D1 database name if you named it something different during setup.
Step 4: Redeploy
npx wrangler deployStep 5: Verify
Open your web UI or send a test recall from Claude. If it responds normally, you’re good.
Open an issue at github.com/rahilp/second-brain-cloudflare/issues and include:
- Which upgrade method you used
- The error message you saw
- Which version you were on and which you upgraded to