xdmorgan / wordpress-to-contentful Goto Github PK
View Code? Open in Web Editor NEWMigrate WordPress posts to Contentful using the WP REST API and the Contentful JS SDK.
License: MIT License
Migrate WordPress posts to Contentful using the WP REST API and the Contentful JS SDK.
License: MIT License
Check for http & https in find/replace
Thank you for sharing your script, it works like a charm!
However I stumbled upon an validation error with RichText fields when uploading posts to contentful which I could not solve and for which I am unable to find any documentation of. Maybe someone knows more?
(The value of the body and excerpt are in all cases not simple strings as in this example but transformed markdown from wordpress posts from the output of this script)
Thank you!
("node":30500) UnhandledPromiseRejectionWarning:"InvalidEntry":{
"status":422,
"statusText":"Unprocessable Entity",
"message":"Validation error",
"details":{
"errors":[
{
"name":"type",
"value":"Here is the body of the Blogpost",
"type":"RichText",
"details":"The type of \"value\" is incorrect, expected type: RichText",
"path":[
"fields",
"body",
"en-US"
]
},
{
"name":"type",
"value":"This is the Blog post excerpt",
"type":"RichText",
"details":"The type of \"value\" is incorrect, expected type: RichText",
"path":[
"fields",
"description",
"en-US"
]
}
]
},
"request":{
"url":"entries",
"headers":{
"Accept":"application/json, text/plain, */*",
"Content-Type":"application/vnd.contentful.management.v1+json",
"X-Contentful-User-Agent":"sdk contentful-management.js/5.28.0; platform node.js/v12.18.3; os Windows/10.0.17763;",
"Authorization":"Bearer ...wIpJw",
"user-agent":"node.js/v12.18.3",
"Accept-Encoding":"gzip",
"X-Contentful-Content-Type":"blogPost",
"Content-Length":5026
},
"method":"post",
"payloadData":"{\"fields\":{\"title\":{\"de\":\"Interview zu Kleinstunternehmen in Wirtschaftswissenschaften und -ethik\"},\"body\":{\"de\":\"Here is the body of the Blogpost"},\"description\":{\"de\":\"This is the Blog post excerpt"},\"slug\":{\"de\":\"interview-zu-kleinstunternehmen-in-wirtschaftswissenschaften-und-ethik\"},\"publishDate\":{\"de\":\"2018-10-07T12:59:06+00:00\"},\"heroImage\":{\"de\":{\"sys\":{\"type\":\"Link\",\"linkType\":\"Asset\",\"id\":\"64sKvWtGm6c1zjtgeJadku\"}}},\"author\":{\"de\":{\"sys\":{\"type\":\"Link\",\"linkType\":\"Entry\",\"id\":\"12\"}}}}}"
},
Getting Error when importing. Was wondering if this is a content model error.
Contentful import
✖ Upload assets
→ }
Match WP 'User' to Contentful 'Person'
Create Posts
NotFound: {
"status": 404,
"statusText": "Not Found",
"message": "The resource could not be found.",
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.