49 lines
2.3 KiB
Markdown
49 lines
2.3 KiB
Markdown
# Esun Blog Import
|
|
|
|
Imports the four extracted `esun_*_details.json` files and their referenced HTML files into Mageplaza Blog.
|
|
|
|
## Deployment
|
|
|
|
Extract `esun.zip` directly into `var/import`, enable the module, and run Magento setup:
|
|
|
|
```bash
|
|
bin/magento module:enable Esun_BlogImport
|
|
bin/magento setup:upgrade
|
|
```
|
|
|
|
Validate before importing:
|
|
|
|
```bash
|
|
bin/magento esun:blog:import --dry-run
|
|
```
|
|
|
|
Run the import after validation succeeds:
|
|
|
|
```bash
|
|
bin/magento esun:blog:import
|
|
```
|
|
|
|
The default media location is `pub/media/mageplaza/blog/post/uploads`. Missing media fails validation by default.
|
|
The importer also detects JPG, PNG, and GIF files whose binary data has a different format (for example,
|
|
WebP data saved with a `.jpg` extension). A real import converts these files in place to the format declared
|
|
by the extension so Mageplaza can resize them; `--dry-run` only reports how many require conversion.
|
|
Animated WebP data requires `ffmpeg`, or the WebP command-line tools `webpmux` and `dwebp`, on the import host.
|
|
`--allow-missing-media` is available for an intentional partial media migration.
|
|
|
|
Image and video URLs on `esun3d.com` or `www.esun3d.com`, plus source-relative `/uploads/...` URLs, are rewritten to
|
|
Magento media directives under the configured media subdirectory. Media URLs on every other domain are left intact.
|
|
|
|
Each `esun_*_all.json` file supplies list-card data. `summary` is imported into `short_description`, while `imageUrl`
|
|
is reduced to its local filename and stored as `uploads/<filename>` in the post `image` field. Mageplaza resolves and
|
|
resizes these covers natively from `pub/media/mageplaza/blog/post/uploads`.
|
|
|
|
Use `--store-id=<id>` to assign posts to a particular store. The default is store ID `0` (all stores).
|
|
|
|
The importer is idempotent. It identifies imported posts by `import_source`, merges duplicate JSON entries into one
|
|
post with multiple category relations, and refuses to overwrite an unrelated post that uses the same URL key.
|
|
Imported posts are enabled, excluded from RSS (`in_rss = 0`), use the two-column left-sidebar layout
|
|
(`layout = 2columns-left`), and are saved with comments disabled (`allow_comment = 0`).
|
|
|
|
The module also changes `mageplaza_blog_post.post_content` from `TEXT` to `MEDIUMTEXT`. Processed HTML is validated
|
|
against the 16,777,215-byte `MEDIUMTEXT` limit before any post is written.
|