[Feature request] Export and import feature.
The export and import feature is very useful for the user to backup or migrate between different Moonglade instances. Or even migrate from pure HTML file to Moonglade.
This feature will make Moonglade:
- Easier migrate from other types to Moonglade.
- Easier migrating Moonglade data to another instance.
- Easier merging two Moonglade instances into one.
- Easier switching database types.
- Easier backup.
For example, I know a lot of users who write blog with pure markdown and publish those pure markdown files. If this feature is supported, they can easily migrate from markdown to Moonglade.
And for another example, if I want to migrate Moonglade from US to China, I can:
- Export Moonglade on US.
- Deploy a new instance in China.
- Impport Moongalde in China.
This could make migrating super easy that without knowledge about database.
And this feature can even allow user to switch database types, like from MySQL to MSSQl.
Export feature
There should be two approaches for exporting.
Export as zip
Exporting as zip will zip all blog content with extensions like .html or .md, and zip them.
There should also be a meta json file along side it. The meta file contains data like publish date, comments, hits and if is featured, etc.
For example:
Export-Result.zip
blog1.md
blog1-meta.json
blog2.md
blog2-meta.json
blog3.md
blog3-meta.json
Export as Json
Exporting as JSON should directly call JsonConvert.SeralizeObject(posts) with metadata inside.
Import
Of course, the user should be able to import content from JSON, or a markdown folder(zipped)