Skip to content

Data Migration Best Practices

Master advanced migration techniques, avoid common pitfalls, and ensure smooth transitions for complex data scenarios.

Analyze current state:

Data inventory:

Files:
Total files: 1,247
Total size: 45 GB
File types: PDF (60%), ZIP (25%), Video (10%), Other (5%)
Largest file: 3.2 GB (training-video.mp4)
Products:
Digital products: 89
Products with files: 89
Average files per product: 14

Customer data:

Total customers: 3,456
Active downloads: 234
Recent purchases (< 30 days): 156
Pending orders: 12

Identify risks:

Migration risks:

HIGH RISK:
• Broken download links (active customers)
• Data loss during transfer
• Downtime during peak sales
MEDIUM RISK:
• File corruption
• Product mapping errors
• Email deliverability issues
LOW RISK:
• Minor UI differences
• Temporary slow performance
• Analytics data gap

Mitigation strategies:

High risks:
→ Dual-run period (old + new app)
→ Complete backups before starting
→ Migrate during low-traffic period
Medium risks:
→ Verify file integrity
→ Test product mappings
→ Setup email authentication early
Low risks:
→ Document for customers
→ Monitor performance
→ Accept small data gaps

Create migration schedule:

Phased migration (recommended):

Week 1: Preparation
• Install Alva
• Export data from old app
• Clean and organize files
• Document current setup
Week 2: File Migration
• Upload files to Alva
• Verify file integrity
• Create packs
• Tag and organize
Week 3: Product Setup
• Map products to files
• Configure settings
• Setup email templates
• Test workflows
Week 4: Testing
• Create test orders
• Verify download flow
• Test fraud prevention
• Mobile testing
Week 5: Soft Launch
• Enable for new orders only
• Keep old app for existing orders
• Monitor closely
• Quick rollback if issues
Week 6+: Full Migration
• Migrate active download links
• Retire old app
• Final verification

Clean data before migrating:

File cleanup:

Remove:
☑ Duplicate files
☑ Unused files (not mapped to products)
☑ Old versions (keep latest only)
☑ Test files
☑ Temporary files
Optimize:
☑ Compress large files
☑ Standardize naming
☑ Organize into folders
☑ Add descriptive names

Product cleanup:

Review products:
☑ Remove discontinued products
☑ Merge duplicate products
☑ Update product names/SKUs
☑ Verify all products active
☑ Archive old products (don't delete)
Benefits:
• Cleaner migration
• Easier mapping
• Better organization
• Reduced confusion

Validate data quality:

File validation:

Check each file:
☑ Opens correctly
☑ Not corrupted
☑ Correct file type
☑ Reasonable file size
☑ Named appropriately
Tools:
• PDF: Open in Adobe Reader
• ZIP: Extract and verify contents
• Images: View in image viewer
• Videos: Play in video player
Corrupted files: Fix or replace before migrating

Product mapping validation:

Verify:
☑ Each product has files
☑ Files match product description
☑ No missing files
☑ No wrong files assigned
☑ Pricing matches offering
Create validation spreadsheet:
Product | Expected Files | Actual Files | Match?
Course A | 12 chapters | 12 chapters | ✓
Course B | 8 modules | 7 modules | ✗ (missing file)

Choose optimal transfer method:

Small migration (< 50 files, < 10 GB):

Method: UI bulk upload
Process:
1. Select all files
2. Drag and drop to Alva
3. Wait for completion
4. Verify all uploaded
Time: 30-60 minutes
Complexity: Low
Risk: Low

Medium migration (50-500 files, 10-100 GB):

Method: FTP + CSV import
Process:
1. FTP upload files to server
2. Create CSV with file mappings
3. Import CSV to Alva
4. Auto-map products
5. Verify mappings
Time: 2-4 hours
Complexity: Medium
Risk: Medium

Large migration (500+ files, 100+ GB):

Method: API + Background processing
Process:
1. Upload files to cloud storage (S3, R2, etc.)
2. Script API calls to import
3. Batch processing (100 files at a time)
4. Monitor progress
5. Handle errors automatically
6. Final verification
Time: 4-24 hours
Complexity: High
Risk: Medium (with proper monitoring)

Speed up migration:

Parallel upload:

Instead of:
Upload 1000 files sequentially (10 hours)
Do this:
Split into 10 batches of 100 files
Upload batches in parallel
Total time: 2 hours (5x faster)
Tools:
• Multiple FTP connections
• API with concurrent requests
• Multiple browser tabs

Ensure data integrity:

Checksum verification:

For each file:
1. Calculate MD5 hash before upload
2. Upload file
3. Calculate MD5 hash after upload
4. Compare hashes
Match: File transferred correctly ✓
Mismatch: Re-upload file ✗
Automated script:
```bash
#!/bin/bash
for file in *.pdf; do
local_md5=$(md5sum "$file" | cut -d' ' -f1)
remote_md5=$(ssh server "md5sum /path/$file" | cut -d' ' -f1)
if [ "$local_md5" == "$remote_md5" ]; then
echo "$file: OK"
else
echo "$file: MISMATCH - Re-uploading"
scp "$file" server:/path/
fi
done

Smart product mapping:

Fuzzy matching:

Filename: "Course Bundle Chapter 1.pdf"
Products:
• "Complete Course Bundle" (85% match) ✓
• "Course Introduction Pack" (60% match)
• "Starter Bundle" (30% match)
Auto-map threshold: 80%
Result: Maps to "Complete Course Bundle"
Manual review: Matches 60-79%

Pattern-based mapping:

Filename pattern: {SKU}_{description}.{ext}
Examples:
COURSE-001_ch1.pdf → SKU: COURSE-001
EBOOK-123_guide.pdf → SKU: EBOOK-123
Mapping rules:
1. Extract SKU from filename (before first _)
2. Find product with matching SKU
3. Map file to product
4. Set tags from description
Success rate: 95%+ (with proper naming)

Complex mapping scenarios:

Variant-specific files:

Product: "Language Course"
Variants:
• English version
• Spanish version
• French version
Files:
course_en.pdf → English variant
course_es.pdf → Spanish variant
course_fr.pdf → French variant
Mapping:
Match file suffix (_en, _es, _fr) to variant
Auto-assign correct file to each variant

Multi-product files:

Scenario: Same file used in multiple products
File: "Bonus-Guide.pdf"
Products:
• Starter Pack
• Premium Pack
• Ultimate Bundle
Solution:
1. Upload file once
2. Map to all 3 products
3. Single storage, multiple mappings
Benefits:
• Save storage space
• Consistent updates
• Efficient management

Migrate very large files (> 1 GB):

Chunked upload:

File: training-video.mp4 (3.2 GB)
Process:
1. Split into 100 MB chunks
2. Upload chunks sequentially
3. Reassemble on server
4. Verify complete file
5. Delete chunks
Benefits:
• Resume on failure
• Better progress tracking
• Avoid timeouts

Streaming upload:

For very large files (> 5 GB):
Use streaming upload (direct to cloud storage)
Process:
1. Generate presigned upload URL
2. Stream file directly to R2/S3
3. No server intermediary
4. Register file in Alva after upload
Advantages:
• Faster upload
• No server load
• No size limits

Handle filenames with special characters:

Common issues:

Problematic characters:
• Spaces: "File Name.pdf"
• Accents: "Café Guide.pdf"
• Symbols: "Price & Value.pdf"
• Unicode: "日本語.pdf"
Solutions:
1. URL encode: "Caf%C3%A9+Guide.pdf"
2. Sanitize: "Cafe_Guide.pdf"
3. Keep original display name, use safe filename internally

Best practice:

Original: "Café & Restaurant Guide.pdf"
Display name: "Café & Restaurant Guide.pdf" (shown to customers)
System filename: "cafe-and-restaurant-guide.pdf" (stored internally)
Result: Best of both worlds

Handle duplicate files:

Detection:

Find duplicates by:
• Filename match
• File size match
• MD5 hash match (exact content)
Results:
Exact duplicates: 45 files
Similar names: 12 files
Same content, different names: 8 files

Resolution strategies:

Strategy 1: Keep first, skip rest
Use: When files identical
Strategy 2: Keep newest
Use: When files are versions
Strategy 3: Merge mappings
File exists → Add product mappings to existing file
Result: One file, multiple product maps
Strategy 4: Rename and keep both
Use: When files actually different despite same name

Test checklist:

Functional testing:

☐ File upload works
☐ Product mapping accurate
☐ Download links work
☐ Email notifications sent
☐ Fraud prevention functions
☐ Expiry calculated correctly
☐ Limits enforced
☐ Customer account shows downloads
☐ Mobile downloads work
☐ Search finds files
☐ Analytics tracking accurate

Load testing:

Simulate high load:
• 100 concurrent downloads
• 50 orders per hour
• 20 file uploads simultaneously
Monitor:
• Response times
• Error rates
• Server resources
• Database performance
Target:
< 2s page load
< 5s download link generation
Zero errors under normal load

Compare old vs new:

Run parallel test:

Week 1 of migration:
50% of orders → Old app
50% of orders → Alva
Measure:
• Download success rate
• Email delivery rate
• Customer satisfaction
• Support tickets
• Processing time
Compare results:
Old app: 96% success, 2.3 avg support tickets
Alva: 98% success, 1.1 avg support tickets
Decision: Proceed with full migration

Optimize for scale:

Indexing:

Critical indexes:
• Product SKU (for mapping)
• File hash (for duplicate detection)
• Customer email (for order lookup)
• Download token (for link validation)
Result: 10x faster queries

Query optimization:

Before:
Load all files → Filter in app → Display
Time: 5 seconds (1000 files)
After:
Query with filters → Load only needed → Display
Time: 0.3 seconds
Technique: Database-level filtering

Implement caching:

File metadata cache:

Cache: File list, product mappings, settings
Duration: 1 hour
Invalidate: On file upload, delete, mapping change
Benefits:
• Faster page loads
• Reduced database queries
• Better user experience

CDN caching:

Cache files on CDN:
• Static files: 1 year
• Download pages: 1 hour (dynamic content excluded)
• Product images: 30 days
Result: 90% faster global access

Plan for failure:

Pre-rollback preparation:

Before migration:
☑ Full backup of old app
☑ Export all data
☑ Document current configuration
☑ Keep old app installed
☑ Define rollback criteria
Rollback triggers:
• >10% increase in errors
• >20% decrease in conversion
• Critical functionality broken
• >50 support tickets in 24h

Rollback procedure:

If rollback needed:
Immediate (< 1 hour):
1. Disable Alva for new orders
2. Re-enable old app
3. Announce to customers
4. Redirect download links
Full rollback (< 24 hours):
1. Export any data from Alva
2. Restore old app configuration
3. Migrate new orders back to old app
4. Uninstall Alva
5. Post-mortem analysis
6. Plan retry after fixes

Post-migration checklist:

Data verification:

☐ All files migrated (count match)
☐ File integrity verified (hash match)
☐ Product mappings correct
☐ Download links working
☐ Email notifications sending
☐ Analytics tracking
☐ No customer complaints
☐ Support tickets normal levels

Monitor closely:

First 24 hours:

Check every hour:
• Error logs
• Support tickets
• Email delivery
• Download success rate
• Server performance
Red flags:
• >5% error rate
• >10 support tickets
• Slow response times (>5s)

First week:

Daily checks:
• Overall metrics
• Customer feedback
• Performance trends
• Support ticket volume
• Revenue impact
Success indicators:
• <2% error rate
• Normal support volume
• Positive customer feedback
• No revenue decrease

Post-migration cleanup:

Remove old data:

After successful migration:
Immediately:
☑ Stop using old app for new orders
☑ Monitor both systems in parallel
After 30 days:
☑ Export final data from old app
☑ Verify no active links in old app
☑ Uninstall old app
☑ Cancel old app subscription
After 60 days:
☑ Archive old app data
☑ Remove temporary migration files
☑ Update documentation
☑ Delete old backups (keep final backup)

Post-migration analysis:

Document lessons learned:

What went well:
• File upload faster than expected
• Auto-mapping 95% accurate
• Zero downtime
• Positive customer feedback
What could improve:
• Some filenames needed manual cleanup
• Email setup took longer than planned
• Need better progress visibility
• Testing should be more thorough
Action items:
• Create filename standardization guide
• Improve email setup documentation
• Add progress tracking to UI
• Develop comprehensive test suite

Create migration playbook:

Document your process:

Include:
☑ Step-by-step procedure
☑ Timing estimates
☑ Risks and mitigation
☑ Tools used
☑ Scripts created
☑ Common issues and solutions
☑ Contact information
☑ Success criteria
Use for:
• Future migrations
• Staff training
• Process improvement
• Audit trail

Incremental migration:

Don't migrate everything at once:
Phase 1: Migrate 1 product (low-value)
Test: 1 week, monitor closely
Phase 2: Migrate 10% of products
Test: 2 weeks, refine process
Phase 3: Migrate 50% of products
Test: 2 weeks, gain confidence
Phase 4: Migrate remaining products
Result: Smooth, low-risk migration

Automation opportunities:

✓ File upload (batch scripts)
✓ Product mapping (SKU matching)
✓ Data validation (checksums)
✓ Progress monitoring (alerts)
✓ Error handling (retry logic)
✓ Documentation (auto-generated logs)
Time saved: 60-80%
Error reduction: 90%

Stakeholder communication:

Before migration:
• Announce plan to customers
• Set expectations
• Provide timeline
• Share support contact
During migration:
• Status updates
• Issue transparency
• Response to concerns
After migration:
• Success announcement
• Thank customers for patience
• Highlight improvements
• Gather feedback

Get help when needed:

DIY migration: 1-2 weeks
With support: 2-3 days
Support options:
• Dedicated migration specialist
• Screen sharing sessions
• Custom scripts
• 24/7 availability during migration
Cost: Worth it for complex migrations

Take your time:

Rushed migration risks:
• Data loss
• Broken links
• Customer frustration
• Revenue loss
• Permanent damage
Proper timeline:
• Plan: 1-2 weeks
• Execute: 2-4 weeks
• Monitor: 2-4 weeks
• Total: 5-10 weeks
Result: Smooth, successful migration


Need migration assistance? Contact support for expert help with your migration project.