Skip to content

Document moving an existing site into GOBLOG_DATA_DIR - #675

Merged
compscidr merged 1 commit into
mainfrom
docs/move-into-data-dir
Oct 3, 2026
Merged

compscidr merged 1 commit into
mainfrom
docs/move-into-data-dir

Conversation

@compscidr

Copy link
Copy Markdown
Collaborator

Closes #670.

A new section at the top of UPGRADING.md, linked from the README's Docker section: stop goblog, copy .env, the SQLite file, www/uploads, plugins/wasm, plugins/dynamic and themes/installed into the data directory (table of old and new names), point sqlite_db at the copy, start with GOBLOG_DATA_DIR and one mount, then check.

It calls out the trap in step 3: a relative sqlite_db is now resolved inside the data directory, so a ../database.db path (which some deployments use) would point at the data directory's parent. It also notes the two things that still read only from the working directory, /wp-content/uploads/ and local.env.

I did not add a goblog migrate-data-dir command; the copy is six paths and differs per deployment.

Testing

Followed the steps on a real site: installed one in the old layout with a password admin, a title and an upload; stopped it; copied .env, the database, uploads and plugins out of the container into a host directory; started a new container with GOBLOG_DATA_DIR on that directory. After the move the log showed Data directory: /data, the site had its title and no install wizard, the upload was served at the same URL, and the password admin could sign in.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 3, 2026 17:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

It is a documentation-only change whose every technical claim and the README anchor link were verified correct against the current code and release metadata.

Review effort: Balanced
Findings: None

What changed in this PR

This is a documentation-only PR that closes #670. It adds an UPGRADING.md section describing how to migrate an existing GoBlog deployment (one that predates GOBLOG_DATA_DIR, introduced in v0.14.0) into a single data directory, and links to it from the README's Docker section. It deliberately does not add a goblog migrate-data-dir command, instead documenting the six-path manual copy.

Changes:

  • Adds a "Moving an existing site into GOBLOG_DATA_DIR" section to UPGRADING.md with a before/after path table, the sqlite_db relative-path trap, a Docker run example, and the two working-directory-only paths (/wp-content/uploads/ and local.env).
  • Appends a sentence to the README's GOBLOG_DATA_DIR paragraph linking to the new UPGRADING.md section.
File Description
UPGRADING.md New top section documenting the manual migration steps, path mapping table, and caveats.
README.md Adds a cross-reference link from the Docker/GOBLOG_DATA_DIR paragraph to the new UPGRADING.md section.

I verified the following claims against the code and release metadata, all of which are accurate:

  • Docker working directory /go/src/github.com/compscidr/goblog (Dockerfile WORKDIR).
  • Path mappings: uploads www/uploads/ → uploads/ (admin/admin.go:212-218, goblog.go:602), plugins/{wasm,dynamic} (goblog.go:440,444), themes/installed/ (theme/theme.go:34), and .env/SQLite via datadir.Path (datadir.go:26-32, db.go:143).
  • THEMES_INSTALLED_DIR takes precedence over the data directory ("still wins") — theme/theme.go:30-34.
  • Relative sqlite_db resolves inside the data directory; absolute used as-is — datadir.go:28, db.go:143.
  • /wp-content/uploads/ is served only from www/ (goblog.go:685); local.env is a working-directory-only fallback for .env (blog/blog.go:1399-1402).
  • Startup log line Data directory: /data (goblog.go:324) and .env carrying SESSION_KEY (goblog.go:340,353).
  • Version 0.14.0 exists (released 2026-10-03) and the datadir package did not exist at v0.13.2, confirming "from 0.14.0".
  • The README anchor #moving-an-existing-site-into-goblog_data_dir correctly matches GitHub's generated anchor for the new heading.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@compscidr
compscidr force-pushed the docs/move-into-data-dir branch from dcf102b to c6b9dd4 Compare October 3, 2026 17:33
@compscidr
compscidr merged commit 7956ef9 into main Oct 3, 2026
5 checks passed
@compscidr
compscidr deleted the docs/move-into-data-dir branch October 3, 2026 17:55
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.

Document moving an existing site into GOBLOG_DATA_DIR

2 participants