Giter VIP home page Giter VIP logo

wordpress-to-sanity's Introduction

Wordpress to Sanity

⚠️ Not production code This is primarily an example of how you can script a Wordpress to Sanity.io migration. You most probably have to tweak and edit the code to fit to your need.

Getting started

  1. Clone this repo
  2. Set const filename in migrate.js to the path of your wordpress export xml file
  3. Run npm start to log out the converted sanity documents in the terminal
  4. Pipe the output to an import file by npm start > myImportfile.ndjson
  5. Try to import the file with sanity dataset import myImportfile.ndjson in your Sanity project folder

Mostly probably there is additional content that this script doesn't migrate, however, it should cover the most usual patterns, so that you can build it out for your specific use case.

  • This script reads the wordpress export XML file
  • This example is based on the blog template schema
  • There's a bug in xml-stream where it doesn't seem to emit errors
  • Debugging deserialization (parseBody.js) is easier with the script in /test
  • Remember to add additional supported custom types to /schemas/defaultSchema.js
  • The HTML is sanitized, but most HTML tags are allowed (check /lib/sanitizeHTML.js)

wordpress-to-sanity's People

Contributors

kmelve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wordpress-to-sanity's Issues

No output or errors - is this still working?

Doesn't seem to be working.

The script is missing from package.json, and if I run node migrate.js after adding the filename, nothing happens. Just blank. No error messages displayed either.

Any tips on getting it to work? This script would save me hours of work.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.