Before You Begin
You’ll need three pieces of information from your Sanity project:- Project ID - Found in your Sanity dashboard
- Dataset name - Usually
productionordevelopment - API Token - Must have Editor permissions
Need help finding these?
See prerequisites for detailed instructions
Find Your Sanity Credentials
Get Your Project ID
1
Go to sanity.io/manage
Navigate to sanity.io/manage
2
Select your project
Click on the project you want to migrate content into
3
Copy the Project ID
Find the Project ID in the project settings or URLExample:
abc123xyzChoose Your Dataset
Your dataset is where content will be imported. Common options:production- Your live, published contentdevelopment- Test/staging environmentstaging- Pre-production environment
Create an API Token
1
Go to API settings
In your Sanity project management console, click API in the sidebar
2
Click 'Add API Token'
Create a new token with these settings:
- Name: MigrateKit Migration
- Permissions: Editor (required for creating documents)
3
Copy the token immediately
Save it somewhere safe—you won’t be able to see it again
Connect in MigrateKit
Add Your Sanity Project
If you haven’t added a Sanity project yet:1
Click 'Add Sanity Project'
In your ContentWrap dashboard (app.contentwrap.io), navigate to Settings → Sanity Projects
2
Enter your credentials
Fill in the form:
- Project ID: Your Sanity project ID
- Dataset: Your dataset name
- API Token: The token you created
3
Test the connection
Click Test Connection to verify credentials
You should see “Connection successful” with your project name
4
Save the project
Click Save to store your Sanity project in your account
Select an Existing Project
If you’ve already connected a Sanity project:1
Choose from dropdown
Select your project from the Sanity Project dropdown
2
Select dataset
Choose which dataset to import into
Troubleshooting Connection Issues
'Invalid API token' error
'Invalid API token' error
Causes:
- Token was copied incorrectly (extra spaces/characters)
- Token doesn’t have Editor permissions
- Token was revoked or deleted
- Create a new token with Editor permissions
- Copy the entire token without extra spaces
- Make sure you’re using the correct project
'Project not found' error
'Project not found' error
Causes:
- Project ID is incorrect
- Typing error in Project ID
- Using project name instead of ID
- Double-check Project ID in your Sanity dashboard
- Copy-paste instead of typing manually
- Project ID is alphanumeric (e.g.,
abc123xyz), not the project name
'Dataset not found' error
'Dataset not found' error
Causes:
- Dataset name is misspelled
- Dataset doesn’t exist in this project
- Capitalization is wrong
- Verify dataset name in Sanity project settings
- Dataset names are case-sensitive
- Create the dataset in Sanity if it doesn’t exist
'Insufficient permissions' error
'Insufficient permissions' error
Cause: API token doesn’t have Editor permissionsFix:
- Create a new token with Editor role
- Delete the old token for security
- Update the token in your dashboard
Security & Best Practices
Protect Your API Token
- Never commit tokens to git - Add to
.gitignore - Don’t share publicly - Treat like a password
- Revoke unused tokens - Delete tokens you’re not using
- Use environment variables - For automation/scripts
Token Management
- Create project-specific tokens - One per project/tool
- Name tokens clearly - E.g., “MigrateKit Migration - Production”
- Rotate periodically - Create new tokens, revoke old ones
- Revoke if compromised - Immediately delete and create new
Multiple Projects
You can connect multiple Sanity projects to your ContentWrap account:- Each project saved separately
- Switch between projects during migration
- Test in development, import to production
Next Step
Once connected, you’re ready to import:Step 4: Import & Verify
Execute the migration and review your content in Sanity