Command Palette

Search for a command to run...

Назад к скиллам
скилл № 01767

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от 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 _binary literals in WP All Import's wp_pmxi_hash table.
  • 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/ shows Error 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)), a sqlite3 .dump), and never write a custom converter: it fails with Could not execute statement: PRAGMA .... The -sqlite.sql output 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 sed stops with "illegal byte sequence" and silently leaves a truncated file. Use LC_ALL=C for sed, grep and diff, or Python in rb/wb mode, 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 example gunzip -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-urls shows the export's WordPress table prefix next to the site's $table_prefix, siteurl and home, and the Studio site's own URL (its custom domain from Studio's site list, such as https://<site>.local) with a planned URL replacement and how many links it would change. tables lists 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:

  1. 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_prefix in the site's wp-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.

  2. 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-users only 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>.

  3. 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 the tables output without deciding for them: large log, statistics or cache tables (for example bad_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

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

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), без исполняемых скриптов.

Похожие скиллы

Сравнить mysql-to-studio-sanitiser с