Migrate from Pinata
A step-by-step guide to migrate your application from Pinata SDK to Pinner.
Why Migrate?
- ✅ Privacy-focused infrastructure - Your data, your control
- ✅ Competitive pricing - Better value for your storage needs
- ✅ Multi-Network Access - Support for multiple storage networks through one service
- ✅ Drop-in compatibility - Minimal code changes required
Migration Strategy
Pinner offers two approaches:
| Approach | Best For | Effort |
|---|---|---|
| Pinata Adapter | Quick migration, minimal changes | Low |
| Native Pinner API | Long-term projects, better features | Medium |
Quick Migration (Using Adapter)
Step 1: Install Pinner
SDK Installation
pnpm
pnpm add @lumeweb/pinnernpm
npm install @lumeweb/pinneryarn
yarn add @lumeweb/pinnerStep 2: Configure Adapter
Choose the appropriate adapter and configure it. See Pinata Adapter Reference for detailed setup instructions.
For Pinata SDK 2.x:import { pinataAdapter } from "@lumeweb/pinner";import { pinataLegacyAdapter } from "@lumeweb/pinner";Step 3: Replace Initialization
Replace your Pinata SDK initialization with the Pinner adapter. See Adapter Quick Setup for detailed examples.
The adapter provides the same API as Pinata SDK. See the API Comparison for a complete mapping.
See Code Examples for comprehensive side-by-side code comparisons.
Migration Checklist
- Install
@lumeweb/pinnerpackage - Update imports and initialization
- Replace API calls with adapter calls
- Add
.execute()to builder methods (v2 adapter) - Test file uploads
- Test file listing and deletion
- Update error handling (see Code Examples)
- Remove Pinata SDK dependency
- Deploy and monitor
Common Patterns
See Code Examples for comprehensive side-by-side comparisons of:
- File uploads
- Directory uploads
- JSON uploads
- Base64 uploads
- Pinning by CID
- Listing files
- Deleting files
- And more
Handling Differences
Builder Pattern (v2 Adapter)
The v2 adapter uses a builder pattern. Chain methods and call .execute(). See Builder Patterns for detailed examples.
Error Handling
Pinner errors follow a different structure. See Error Handling Examples.
Unsupported Features
Some Pinata features are not supported. See Unsupported Features for details and alternatives.
Testing Your Migration
- Test in development - Verify all upload operations work
- Check file listings - Ensure metadata is preserved
- Verify deletions - Test unpin operations
- Monitor performance - Compare upload speeds
- Check costs - Review your billing
Next Steps
- 📖 API Reference - Complete adapter documentation
- 💻 Code Examples - Detailed code comparisons
- 🚀 Native API - Using Pinner without adapter
- 📚 Concepts - Understanding CIDs and IPFS