mysql-to-studio-sanitiser
Make a MySQL database export (mysqldump, host backup or phpMyAdmin on a MySQL server) importable into a WordPress Studio local site, which runs on SQLite. Use…
от lightspeedwp★ 20 звёзд на GitHub
Установить mysql-to-studio-sanitiser в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
MySQL to Studio Sanitiser
Make a MySQL export of a WordPress database importable into a WordPress Studio local site (SQLite through the SQLite Database Integration plugin). This skill writes a cleaned copy beside the original and reports every change.
It packages the fixes for real failed imports:
- 2026-10-13: Studio rejected a GTID replication statement, then raw
_binaryliterals in WP All Import'swp_pmxi_hashtable. - 2026-10-14: a phpMyAdmin export from MariaDB 13 failed on
DEFAULT x AS `0000...`in ten Wordfence tables. A hand-made native SQLite conversion of the same dump then failed on its first line,PRAGMA foreign_keys=OFF.
When to use this skill
- A Studio import fails and
~/Library/Logs/Studio/showsError during import of ... Could not execute statement: .... - Before importing a live or staging export into Studio, to catch the known problems first.
Rules
- The output must stay MySQL syntax. Studio's importer (and the
phpMyAdmin bundled with Studio) send every statement through the SQLite
Database Integration plugin, which parses MySQL and translates it to SQLite
itself. Never convert a dump to SQLite's own dialect (
PRAGMA,AUTOINCREMENT,WITHOUT ROWID,BEGIN TRANSACTION,INSERT OR ...,replace(...,char(13)), asqlite3 .dump), and never write a custom converter: it fails withCould not execute statement: PRAGMA .... The-sqlite.sqloutput name means "ready for Studio", not "SQLite syntax". - Never modify the original file. Write the cleaned copy beside it as
<name>-sqlite.sql. - Change only statements SQLite or the Studio importer cannot run. Everything else stays byte-for-byte identical.
- Treat the dump as bytes. It may contain non-UTF-8 data. On macOS, plain
sedstops with "illegal byte sequence" and silently leaves a truncated file. UseLC_ALL=Cforsed,grepanddiff, or Python inrb/wbmode, and always compare line counts afterwards. - Never print data rows, password hashes, email addresses or API keys from the dump. Refer to tables, lines and counts.
- Ask before changing anything outside the known fixes below.
Procedure
1. Prepare the input and ask the user
If the export is compressed (
.sql.gz,.zip), extract it to a new file first (for examplegunzip -k export.sql.gz). Never overwrite the archive.Note the input's size and line count.
Confirm which Studio site the export is for (
~/Studio/<site>). The import replaces that site's database, so the name matters.Read the export and the site together:
node agents/wp-db-migration-agent/lib/sql-tool.cjs site-urls <export.sql> --studio-site ~/Studio/<site> node agents/wp-db-migration-agent/lib/sql-tool.cjs tables <export.sql>site-urlsshows the export's WordPress table prefix next to the site's$table_prefix,siteurlandhome, and the Studio site's own URL (its custom domain from Studio's site list, such ashttps://<site>.local) with a planned URL replacement and how many links it would change.tableslists every table with its rows, size and group (WordPress core, accounts, Wordfence, plugin or other).
Then ask these questions before running the sanitiser, one message with the facts you found, and wait for the answers:
Table prefix. Say what the export uses and what the Studio site uses. If they differ (
prefix-differs), ask: "Rename the tables to<site prefix>(recommended), keep<export prefix>and change$table_prefixin the site'swp-config.php, or another prefix?" If they already match, say so and ask only if the user wants a different prefix. Never guess: an import under the wrong prefix leaves WordPress unable to see the data.Local user accounts. Ask: "Keep the Studio site's own user accounts (
--keep-users), or replace them with the live site's accounts (the default)?" Explain the trade-off:- Keeping them means you log in as before. Posts and comments keep the live site's author IDs, which may match a different local user or none.
- Replacing them brings the live site's accounts and author links, and you log in with a live-site account.
--keep-usersonly works when the imported tables end up with the Studio site's prefix, because local roles are stored under it (<prefix>capabilities). With--studio-site, the tool refuses a mismatch; add--prefix <site prefix>.Other tables to leave out. Tell the user that Wordfence's tables are left out by default (name them and their size from
tables). Then ask: "Are there any other tables to leave out?" Suggest likely candidates from thetablesoutput without deciding for them: large log, statistics or cache tables (for examplebad_behavior), tables of plugins that are gone or won't run locally, and backup-plugin tables. Never suggest WordPress core tables. Pass each answer as `--exclude <na
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл mysql-to-studio-sanitiser?
Make a MySQL database export (mysqldump, host backup or phpMyAdmin on a MySQL server) importable into a WordPress Studio local site, which runs on SQLite. Use when a Studio import fails with "Could not execute statement", or before importing a live or staging database into Studio. Writes a cleaned copy, never changes the original, and lists every edit.
Как установить скилл mysql-to-studio-sanitiser?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mysql-to-studio-sanitiser запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…