mirror of
https://github.com/go-shiori/shiori.git
synced 2026-04-25 06:25:54 +03:00
[GH-ISSUE #172] Better export method ? #125
Labels
No labels
component:backend
component:builds
component:builds
component:extension
component:frontend
component:readability
database
database:mysql
database:postgres
database:sqlite
feature:ebooks
github_actions
good first issue
hacktoberfest
note:duplicate?
note:fixed?
note:out-of-scope?
os:windows
priority:high
priority:low
pull-request
resolution:as-intended
resolution:cant-reproduce
resolution:duplicate
resolution:fixed
resolution:wontfix
tag:TBD
tag:big-task
tag:help-wanted
tag:huge-data
tag:meta
tag:more-info
tag:next
tag:no-stale
tag:requires-migrations
tag:research
tag:security 🛡️
tag:stale
tag:waiting-for-assignee
type:bug
type:documentation
type:enhancement
type:meta
type:ux
user:cli
user:web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shiori#125
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ekianjo on GitHub (Sep 25, 2019).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/172
Hi, not a feature request per se, but I am wondering if one decides to change from sqlite to an actual db later on, what would be the appropriate way to do it without losing data? Could this be documented in the wiki at some point?
@bvp commented on GitHub (Sep 25, 2019):
@ekianjo Hi
Why not use export/import?
@ekianjo commented on GitHub (Sep 25, 2019):
@bvp I am fine using that, if it's confirmed to work out of the box. Just wondering if this is tried and tested?
@RadhiFadlillah commented on GitHub (Sep 25, 2019):
@ekianjo this is a good point, actually.
Right now when switching database all data will not be moved to the new database. And, unfortunately
exportis not really suitable because it will only give Netscape Bookmark file which only contain title, URL and tag. So, the excerpt, cached content and bookmark's ID (which is vital for specifying the thumbnail and archive) won't be exported.With that said, I think the best direction is to split export to several sub commands. This way, we can also add other export format like static files as specified in #40.
I guess the command might look like this :
@ekianjo commented on GitHub (Sep 25, 2019):
Sounds like a good solution.
@deanishe commented on GitHub (Sep 25, 2019):
If the idea is to re-import the file, I think JSON would be a better solution.
Exporting SQL is great for backup purposes, and every RDBMS can easily export its own flavour of SQL, but it'd be tricky to export MySQL-flavoured SQL from a SQLite database, for example.
I would suggest:
Whereby Shiori can also import any of the formats, but the SQL would only be compatible with the same kind of database it was exported from. The other formats would be database-agnostic.
@ekianjo commented on GitHub (Sep 26, 2019):
@deanishe so how do you import a SQL export ? Is there a SQL export format that works for all kinds of RDBMS?
@deanishe commented on GitHub (Sep 26, 2019):
You pass it straight through to the database engine. It's probably not worth the bother implementing in your own application, however, as every RDBMS comes with tools for backing up & restoring databases, and it's literally a one-liner.
No. Each RDBMS only really speaks its own dialect of SQL, and you can't get one to emit SQL that another understands without (often complex) pre-processing.
As Shiori already knows how to convert its data models to/from JSON, it's probably easiest to use JSON(lines) as the intermediate format for migrating from one database to another.