Hi all,
I’m a new user so I can only put 2 links in this message, so I couldn’t add the various github links and I prefixed them with github →
Currently there’s no easy way to import large datasets into Strapi but there is a very interesting guide on the Strapi website: How to create your own plugin on strapi (1/4)
This blog post is also accompanied by a matching repo: github → jbeuckm/strapi-plugin-import-content
However, as Strapi development moved forward since then, this plugin is not longer working. There are some forks already containing fixes, namely github → akoharu/strapi-plugin-import-content (solves the id
vs _id
problem) and github → khoazero123/strapi-plugin-import-content (solving the path changes and using the strapi-plugin-helper where possible).
By combining both fork’s changes and comparing the structure with a manually generated plugin (using strapi generate:plugin
) I’m using my own fork to come up with a changeset that makes this plugin usable again.
So far I’ve had very mixed results: when following the tutorial and applying the changes from both forementioned forks, I get the plugin to run, EXCEPT the media import from url.
When using the plugin package directly, nothing works and even after applying the fixes, the plugin kinda works but the UI is broken since it’s still using sass instead of the newer styled components (webpack even refuses to parse the scss files)
I’m in dire need to have the media items imported properly from a url and so far this plugin is the only code I’ve seen that tries to do that. Most guides I find involve creating a FormData object and adding the uploaded file in it, to then send it off the the regular endpoints provided by the content-manager. This makes sense when using the frontend to upload images to the media library, however, this plugin is meant to parse files, containing urls, in an async way, so there’s no browser context. Creating FormData objects and sending requests to the api IN BULK doesn’t seem like a good approach here…
The call that consistently fails is the call to the uploadProvider upload method as seen here: strapi-plugin-import-content/importMediaFiles.js at master · jbeuckm/strapi-plugin-import-content · GitHub on lines 22-26
As I am not a Strapi developer, I’m feeling overwhelmed to study the Strapi internals just to revive the import plugin. Has anyone with a more profound knowledge of Strapi the solution to make this plugin functional again?
Kind regards,
Erik aka 4levels