Coder Social home page Coder Social logo

blog_migrate_tool's Introduction

博客迁移到wordpress工具

Abbey最近想要将博客迁移到wordpress,但是网上找了一圈,都没有找到github pages迁移到wordpress的工具,搜出来的都是wordpress迁移到github pages的文章!

现在wordpress那么不受待见了吗?

Anyway,既然找不到工具,那只能自己写脚本来迁移啦!


迁移前提&说明:

  1. 你的github pages有开启sitemap功能
  2. 可以远程连接到你的wordpress数据库
  3. 因为每个人的github pages模板都不一样,因此拿到本脚本需要自己手动修改main.pyGetPostInfo方法,修改正则表达式提取内容、标题、分类

迁移教程:

  1. 安装依赖
pip install -r requirements.txt
  1. 修改配置 修改config.py的配置内容:

    • wordpress相关设置

      • WP_HOST :wordpress数据库ip
      • WP_PORT :MySQL端口,默认3306
      • WP_USER :wordpress数据库用户名
      • WP_PASSWD:wordpress数据库密码
      • WP_DB:wordpress数据库
      • SITE:wordpress网站地址
      • SITE_USER:wordpress网站管理员用户名
      • SITE_PASSWD:wordpress网站管理员密码
    • github pages相关设置

      • github_pages_url:老博客网址
  2. 运行:

python main.py

运行效果图:

blog_migrate_tool's People

Watchers

 avatar

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.