Repository navigation
Document moving an existing site into GOBLOG_DATA_DIR - #675
Conversation
There was a problem hiding this comment.
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, thesqlite_dbrelative-path trap, a Docker run example, and the two working-directory-only paths (/wp-content/uploads/andlocal.env). - Appends a sentence to the README's
GOBLOG_DATA_DIRparagraph 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(DockerfileWORKDIR). - 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 viadatadir.Path(datadir.go:26-32, db.go:143). THEMES_INSTALLED_DIRtakes precedence over the data directory ("still wins") — theme/theme.go:30-34.- Relative
sqlite_dbresolves inside the data directory; absolute used as-is — datadir.go:28, db.go:143. /wp-content/uploads/is served only fromwww/(goblog.go:685);local.envis a working-directory-only fallback for.env(blog/blog.go:1399-1402).- Startup log line
Data directory: /data(goblog.go:324) and.envcarryingSESSION_KEY(goblog.go:340,353). - Version
0.14.0exists (released 2026-10-03) and thedatadirpackage did not exist at v0.13.2, confirming "from 0.14.0". - The README anchor
#moving-an-existing-site-into-goblog_data_dircorrectly 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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Closes #670. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dcf102b to
c6b9dd4
Compare
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/dynamicandthemes/installedinto the data directory (table of old and new names), pointsqlite_dbat the copy, start withGOBLOG_DATA_DIRand one mount, then check.It calls out the trap in step 3: a relative
sqlite_dbis now resolved inside the data directory, so a../database.dbpath (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/andlocal.env.I did not add a
goblog migrate-data-dircommand; 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 withGOBLOG_DATA_DIRon that directory. After the move the log showedData 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