Git Product home page Git Product logo

migrate-webflow-cms-to-sanity's Introduction

Webflow CMS to Sanity Migration Tool

This tool assists users in migrating their Webflow content to Sanity. It fetches collections from Webflow and allows users to select which site and collection they wish to migrate. After selection, the tool maps Webflow items to a predefined Sanity schema, provided by the user, and uploads them to Sanity.

This code contains a demo mapping function for how to handle:

  1. Migrating images from Webflow to Sanity.
  2. Migrating files from Webflow to Sanity.
  3. Migrating Webflow Rich Text Content (HTML) to Sanity Block Content.

Prerequisites

  • Node.js
  • node-fetch, axios, readline, @sanity/client, @sanity/block-tools, @sanity/schema, jsdom, and dotenv npm packages.
  • Webflow API Key
  • Sanity Project ID, Dataset Name, and Sanity Token

Setup

  1. Clone the repository.

    git clone <repository-url>
  2. Navigate to the project directory.

    cd path-to-directory
  3. Install the required npm packages.

    npm install
  4. Setup your environment variables:

    Create a .env file in the root directory and populate it with your Webflow API Key, Sanity Project ID, Dataset Name, and Sanity Token.

    WEBFLOW_API_KEY=YOUR_WEBFLOW_API_KEY
    SANITY_PROJECT_ID=YOUR_SANITY_PROJECT_ID
    SANITY_DATASET=YOUR_SANITY_DATASET_NAME
    SANITY_TOKEN=YOUR_SANITY_TOKEN

Usage

  1. Run the script.

    node path-to-your-script.js
  2. Follow the on-screen prompts to select a Webflow site and collection.

  3. Wait for the content to be migrated. The tool will print progress messages as it processes each item.

Features

  • Fetch all Webflow sites associated with the provided API key.
  • Allow users to select which site and collection they wish to migrate from Webflow.
  • Map Webflow content to a predefined Sanity schema.
  • Handle image and file uploads to Sanity.
  • Report any errors that occur during the migration process.

Notes

  • Ensure you have appropriate permissions for both Webflow and Sanity platforms.
  • It's recommended to run a test migration on a smaller dataset or backup your Sanity dataset before performing a large-scale migration.

License

This project is licensed under the MIT License.

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.