Cms Migration

payloadcms/skills/skills/cms-migration

作者 payloadcms832d5bc4258a無授權條款163 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫8 週前更新

Use when user wants to migrate content from another CMS (WordPress, Contentful, Strapi, Sanity, Webflow, etc.) to Payload CMS

AI 產生的概覽

以設定優先的互動流程,引導將其他 CMS 的內容遷移到 Payload CMS 集合。

功能
此技能透過對話式流程,從來源 CMS 的資料樣本著手,分析資料結構,並提出 TypeScript 形式的 Payload 集合設定。它會與使用者反覆確認每個集合,接著討論遷移順序、關聯對應、媒體處理與富文字轉換。它也會提醒常見的建模陷阱,例如把重複出現的分類字串當成 select 欄位而非關聯。
適用情境
當使用者想將 WordPress、Contentful、Strapi、Sanity、Webflow 或類似 CMS 的內容遷移到 Payload CMS 時使用。適合在資料匯入之前的早期結構設計討論。
執行需求
不隨附指令碼,僅為說明文件。它引用一份隨附的 Payload 欄位參考文件,並假定使用者能提供來源資料樣本(JSON、CSV 或結構描述)。

CMS Migration to Payload

Interactive workflow to design Payload collections from source CMS data. Config-first approach: establish the data structure through conversation before any data import.

Workflow

Start  ↓Ask for data sample  ↓Analyze data shape  ↓Propose collection config  ↓User reviews ──────────────┐  │                        │  ├─ changes needed ───→ Adjust config ──→ (back to User reviews)  │  └─ looks good ───→ Config confirmed                            ↓                    More collections? ──────┐                            │               │                            ├─ yes ──→ (back to Ask for data sample)                            │                            └─ no ───→ All collections confirmed                                              ↓                                      Discuss migration approach                                              ↓                                            Done

Phase 1: Data Analysis

When user provides data (JSON, CSV, or describes their schema):

  1. Identify field types - text, number, date, relationships, media, rich text
  2. Spot patterns - IDs, timestamps, nested objects, arrays
  3. Note relationships - foreign keys, embedded refs, linked content types
  4. Flag ambiguities - fields that could be multiple types, unclear purposes

Phase 2: Propose Collection Config

Present a Payload collection config based on analysis:

typescript
// Example output formatexport const Posts: CollectionConfig = {  slug: 'posts',  fields: [    { name: 'title', type: 'text', required: true },    { name: 'content', type: 'richText' },    { name: 'author', type: 'relationship', relationTo: 'users' },    // ...  ],}

Explain your reasoning for each field choice. When something could go multiple ways (group vs JSON, text vs textarea, select vs relationship), ask rather than assume.

Phase 3: Iterate with User

Work through uncertainties: required fields, hasMany relationships, rich text vs HTML, custom timestamps vs built-in. Continue until the user confirms the config.

Phase 4: Additional Collections

After each confirmation, ask:

"Are there other content types we should create collections for?"

If yes, loop back to Phase 1 with new data sample.

Common related collections to prompt for:

  • Media/uploads
  • Users/authors
  • Categories/tags
  • Settings (global)

Phase 5: Migration Approach

Only after ALL collections are confirmed, discuss data import:

  1. Order matters - which collections have no dependencies? Migrate those first
  2. Relationship mapping - how to resolve source IDs to Payload IDs
  3. Media handling - download/re-upload vs external URLs
  4. Rich text - HTML conversion needs or keep raw

Offer to generate a seed script or walk through manual import.

Things to Clarify

Throughout the process, watch for these:

  • ID references - are they relationships to other collections?
  • Image/file URLs - upload fields or keep as external URLs?
  • Nested objects - group, array, or blocks?
  • Localization - any fields need per-locale values?
  • Access control - who can read/write this collection?
  • Related content types - categories, tags, authors that need their own collections?

Critical: Select vs Relationship

This is the most common migration mistake. Data that looks static often needs to be dynamic.

When you see repeated string values (categories, tags, types, statuses):

json
{ "category": "Technology" }{ "category": "News" }{ "category": "Technology" }

Don't assume it's a select field. Ask:

"I see category has values like 'Technology', 'News'. Should this be:

  • A select field with fixed options (values won't change)
  • A relationship to a Categories collection (users can add/edit/remove categories later)"

Default to relationship for anything that looks like:

  • Categories, tags, topics, labels
  • Authors, assignees, reviewers
  • Statuses beyond simple draft/published
  • Types that might expand over time

Use select only for:

  • Truly fixed enums (yes/no, draft/published/archived)
  • Options defined by business logic, not content (payment status, priority levels)
  • Values that would break functionality if changed (role types with code dependencies)

If creating a relationship, remember to add the related collection (Categories, Tags, etc.) to the migration plan.

Reference Documentation

  • PAYLOAD-FIELD-REFERENCE.md [blocked] - Complete Payload field type schemas with examples

Common Pitfalls

IssueHow to Handle
User provides partial dataAsk for more samples, especially edge cases
Unclear relationshipsAsk user to describe how content types connect
Rich text ambiguityClarify: Lexical editor, Slate, or store raw HTML
Missing media collectionAlways confirm upload collection exists before referencing
Overly complex nested dataConsider flattening or using blocks instead of deep groups

來源與署名

來源:payloadcms/skills位於skills/cms-migration提交832d5bc

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架