Skip to content

Fix SQLite migration for additional account settings - #913

Open
PizzaLovingNerd wants to merge 2 commits into
netbirdio:mainfrom
PizzaLovingNerd:netbird-docs-sqlite-migration-fix
Open

Fix SQLite migration for additional account settings#913
PizzaLovingNerd wants to merge 2 commits into
netbirdio:mainfrom
PizzaLovingNerd:netbird-docs-sqlite-migration-fix

Conversation

@PizzaLovingNerd

@PizzaLovingNerd PizzaLovingNerd commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Updates the SQLite-to-PostgreSQL migration guide to cast two additional account settings to PostgreSQL booleans:

  • settings_metrics_push_enabled
  • settings_agent_network_only

Without these casts, pgloader can retain incompatible SQLite types and defaults, causing the migration to fail with invalid input syntax for type numeric: "false".

The installation instructions now also include the SQLite and PostgreSQL command-line tools used by the guide.

Validation

Tested changes in a fresh Ubuntu 24.04 virtual machine.

  • npm run lint:mdx passes.
  • npm run build passes.
  • git diff --check passes.

Summary by CodeRabbit

  • Documentation
    • Updated SQLite-to-PostgreSQL migration instructions for Debian, Ubuntu, and macOS.
    • Added required SQLite and PostgreSQL tooling to the installation steps.
    • Improved migration handling for settings related to metrics push and agent network access by converting values to boolean format.

@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

@PizzaLovingNerd is attempting to deploy a commit to the NetBird GmbH Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@PizzaLovingNerd, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 796e26da-ff30-4ab5-9874-36b265800468

📥 Commits

Reviewing files that changed from the base of the PR and between 86d457e and b7cbb2b.

📒 Files selected for processing (1)
  • src/pages/selfhosted/maintenance/scaling/migrate-sqlite-to-postgresql.mdx
📝 Walkthrough

Walkthrough

The migration guide now installs required SQLite and PostgreSQL tools on Debian/Ubuntu and macOS. It also casts two account settings to boolean values during migration.

Changes

SQLite to PostgreSQL migration guide

Layer / File(s) Summary
Platform prerequisites
src/pages/selfhosted/maintenance/scaling/migrate-sqlite-to-postgresql.mdx
Installation commands include SQLite tooling and PostgreSQL client dependencies for Debian/Ubuntu and macOS.
Account settings casts
src/pages/selfhosted/maintenance/scaling/migrate-sqlite-to-postgresql.mdx
The migration casts settings_metrics_push_enabled and settings_agent_network_only to boolean values.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Poem

A rabbit checked the migration trail,
Added tools so steps would not fail.
Boolean flags now stand upright,
PostgreSQL receives them right.
Hop, hop—the guide is clear and bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: fixing the SQLite migration for additional account settings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@PizzaLovingNerd
PizzaLovingNerd marked this pull request as ready for review August 11, 2026 22:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pages/selfhosted/maintenance/scaling/migrate-sqlite-to-postgresql.mdx`:
- Around line 49-50: Update the macOS Homebrew installation instructions around
the brew install command to either expose the keg-only sqlite3 and libpq bin
directories on PATH for required host-side tools, or remove those formulas and
clarify they are unnecessary. Ensure the documented command leaves required
sqlite3 and psql tools usable.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 51fcc657-fcfb-4030-89e4-54ec9f897501

📥 Commits

Reviewing files that changed from the base of the PR and between ffe1055 and 86d457e.

📒 Files selected for processing (1)
  • src/pages/selfhosted/maintenance/scaling/migrate-sqlite-to-postgresql.mdx

Comment on lines 49 to +50
# macOS
brew install pgloader
brew install pgloader sqlite3 libpq

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

curl -fsSL https://formulae.brew.sh/api/formula/sqlite.json |
  jq -e '.keg_only and (.aliases | index("sqlite3")) != null'

curl -fsSL https://formulae.brew.sh/api/formula/libpq.json |
  jq -e '.keg_only and (.executables | index("psql")) != null'

Repository: netbirdio/docs

Length of output: 162


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- target section ---'
sed -n '35,90p' src/pages/selfhosted/maintenance/scaling/migrate-sqlite-to-postgresql.mdx

printf '%s\n' '--- tool references in the page ---'
rg -n -C 2 '\b(pgloader|sqlite3|psql|libpq|PATH|brew install)\b' \
  src/pages/selfhosted/maintenance/scaling/migrate-sqlite-to-postgresql.mdx

printf '%s\n' '--- Homebrew metadata relevant to the claim ---'
for formula in sqlite libpq pgloader; do
  curl -fsSL "https://formulae.brew.sh/api/formula/${formula}.json" |
    jq -c '{name,aliases,keg_only,executables,installed_as_dependency,dependencies}'
done

Repository: netbirdio/docs

Length of output: 3881


Expose keg-only Homebrew client tools or remove them from the install command.

Homebrew installs sqlite (sqlite3 alias) and libpq as keg-only formulas. The command does not place sqlite3 or psql on PATH. Add the formula bin directories to PATH if host-side client tools are required. Otherwise, remove these formulas or state that they are not required.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/selfhosted/maintenance/scaling/migrate-sqlite-to-postgresql.mdx`
around lines 49 - 50, Update the macOS Homebrew installation instructions around
the brew install command to either expose the keg-only sqlite3 and libpq bin
directories on PATH for required host-side tools, or remove those formulas and
clarify they are unnecessary. Ensure the documented command leaves required
sqlite3 and psql tools usable.

Source: MCP tools

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.

1 participant