Better export method ? #337
Replies: 8 comments 5 replies
|
@bvp I am fine using that, if it's confirmed to work out of the box. Just wondering if this is tried and tested? |
|
@ekianjo this is a good point, actually. Right now when switching database all data will not be moved to the new database. And, unfortunately 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 : |
|
Sounds like a good solution. |
|
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. |
|
@deanishe so how do you import a SQL export ? Is there a SQL export format that works for all kinds of RDBMS? |
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. |
|
Thanks so much for this great application! Just be here and see this discussion as I also would like to raise feature request regarding exporting to static files like Please allow me to ask if any update and plan on this? Thanks and regards, |
Uh oh!
There was an error while loading. Please reload this page.
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?
All reactions