百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
B

blog-extractor

> 编程语言
开源

WP-CLI 命令。从多站点中提取单个博客

100 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

WP-CLI 命令。从多站点中提取单个博客

Blog Extractor

Warning!

This has had limited testing so far and there may be bugs. Would love feedback from those willing to test this out. There should be no risk to the multisite. In fact, no changes are made to the multisite. But, you know, gremlins.

Installation

As Package

This is the easiest. It will also make the command available anywhere wp is.

wp package install trepmal/blog-extractor

As Standard Plugin

You can also install this command as a standard WordPress plugin, however that means the command will only be available for that WordPress installation where the plugin is active.

wp plugin install https://github.com/trepmal/blog-extractor/archive/master.zip --activate-network

Usage

Extract a single blog from a multisite network. (Does not delete original site)

wp extract 

Creates an tar file in the WordPress root directory. Tar file contains:

  • sql dump of site, including user tables
  • wp-content/
  • uploads/sites/{id}
  • plugins/{active-plugins}
  • plugins/{network-activated plugins} (will need to be reactivated)
  • mu-plugins
  • themes/{active theme} (including parent if needed)
  • dropins (such as object-cache.php)

In setting up the standalone site, a few things need to be done:

  • in wp-config.php change the $table_prefix to match the ID'd prefix from the multisite (this is given in the success message)
  • after the tables are imported
  • run the search-replace command to change the URLs
  • move the uploads from the /sites/{id}/ directory to the main /uploads/ folder
  • run search-replace again to change those affected URLs

Example, if you run

$ wp extract 100

You'd get something like

> Success: archive-100.tar.gz created! (1.33 MB)
> In your new install in wp-config.php, set the $table_prefix to wp_100_
> You'll also need to do a search-replace for the url change
> =========================================
> # update URLs
> wp search-replace ms.dev/montana NEWURL
> # move the uploads to the typical directory
> mv wp-content/uploads/sites/100/* wp-content/uploads/
> # remove the old directory
> rm -rf wp-content/uploads/sites/
> # update database
> wp search-replace wp-content/uploads/sites/100/ wp-content/uploads/
> =========================================

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHP

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言