Overview
PhotoFlow provides CSV import functionality to help you:- Migrate existing data from spreadsheets or other systems
- Bulk operations - Import many tasks at once
- Data portability - Move data between PhotoFlow instances
CSV export is not yet implemented. For backups, use database backups or manual export methods described in this guide.
CSV Import
Import tasks in bulk from a CSV file.CSV File Format
Your CSV file should follow this structure:| Column | Type | Description | Example |
|---|---|---|---|
id | Number | Task ID (can be blank for new tasks) | 1 |
task | String | Task name/title | ”Wedding Photography - Smith” |
dueAt | Date | Due date in ISO format | 2026-03-15 |
status | String | Current status | ”In Progress” |
additional_information | String | Task description | ”Outdoor ceremony, 100 guests” |
is_finished | Boolean | Completion status | false |
taskColumn | String | Column/stage ID | 1 |
Import Process
Prepare CSV File
Create or export your CSV file following the format above. Ensure:
- Dates are in YYYY-MM-DD format
- Boolean values are lowercase:
trueorfalse - Text with commas is enclosed in quotes
- File is UTF-8 encoded
Access Import Functionality
Navigate to the import page or section in PhotoFlow (typically in settings or task management area).
Import API
Import tasks programmatically:API Implementation
The import endpoint is insrc/routes/api/(exportimport)/importcsv/+server.ts:
- Removes the header row
- Maps CSV columns to task fields
- Converts date strings to Date objects
- Converts string “true”/“false” to boolean
- Creates each task in the database sequentially
The import creates NEW tasks. It does not update existing tasks. If you want to update tasks, you’ll need to delete the old ones first or modify the import logic.
CSV Export
Manual Export Alternative
Until the export feature is completed, you can export data manually using Prisma Studio or direct database queries: Using Prisma Studio:Use Cases
Initial Setup
Import existing orders from spreadsheets when first deploying PhotoFlow.
Regular Backups
Use database backups or Prisma Studio exports for regular backups.
Reporting
Export data for analysis using Prisma Studio or database queries.
Migration
Move tasks between different PhotoFlow instances or environments.
Archiving
Export and delete old finished tasks to keep the database lean.
Data Integration
Integrate with other systems that accept CSV imports.
Working with CSV Files
Creating CSV Files
In Excel/Google Sheets:- Enter your data in columns matching the required format
- File > Save As > Choose “CSV (Comma delimited)”
- Ensure UTF-8 encoding if prompted
Editing CSV Files
Best practices:- Use a proper CSV editor or spreadsheet application
- Don’t edit in basic text editors (easy to break formatting)
- Keep quotes around text with commas or special characters
- Use ISO date format (YYYY-MM-DD) for consistency
- Don’t include formulas - export values only
Special Characters
Handle special characters properly:- Quotes inside quoted fields: Use double quotes (
"") - Commas in values: Enclose the entire value in quotes
- Line breaks: Enclose in quotes (though not recommended)
Bulk Operations
Import Large Datasets
For importing hundreds or thousands of tasks:Prepare Data
Clean and validate your CSV file:
- Remove duplicate entries
- Ensure all dates are valid
- Verify column IDs exist
- Check for missing required fields
Performance Considerations
The current implementation imports tasks sequentially:- Using
prisma.tasks.createMany()for batch inserts - Processing in parallel with Promise.all()
- Implementing progress tracking
- Adding validation before import
Data Validation
Required Fields
Ensure your CSV includes:task- Task name (required)dueAt- Due date (required)status- Status stringtaskColumn- Valid column ID
Date Validation
Dates must be in a format that JavaScript’snew Date() can parse:
Valid formats:
Column Validation
EnsuretaskColumn values match your board configuration. Invalid column IDs will cause tasks to not appear correctly.
Error Handling
If import fails:'Invalid!' response
'Invalid!' response
The catch block returns “Invalid!” for any error. Common causes:
- Malformed CSV structure
- Invalid date formats
- Missing required fields
- Database connection issues
Partial import
Partial import
If some tasks import but others fail:
- The current implementation doesn’t use transactions
- Successfully imported tasks remain in database
- Failed tasks are skipped
- Review the CSV for issues in failed rows
Duplicate tasks
Duplicate tasks
Running the same import twice creates duplicate tasks. To avoid:
- Export current tasks first
- Compare IDs
- Delete duplicates manually if needed
Backup Strategy
Since CSV export is not yet implemented, use database backups:Store Securely
Save backups in multiple locations:
- Local server storage
- Network attached storage
- Cloud storage (encrypted)
- External hard drive
See Production Checklist for comprehensive backup best practices.
Troubleshooting
Import fails silently
Import fails silently
- Check browser console for errors
- Verify CSV format matches expected structure
- Review server logs for detailed error messages
- Test with a minimal CSV (1-2 rows)
Dates import incorrectly
Dates import incorrectly
- Use ISO format: YYYY-MM-DD
- Check timezone handling
- Ensure dates are valid (no Feb 30th, etc.)
Special characters appear garbled
Special characters appear garbled
- Ensure CSV is UTF-8 encoded
- Check for BOM (Byte Order Mark) issues
- Test with ASCII-only characters first
Tasks don't appear on board
Tasks don't appear on board
- Verify
taskColumnvalues are valid - Check if tasks are marked
is_finished: true - Refresh the browser
- Check database directly with Prisma Studio
Next Steps
Task Management
Learn about managing tasks after import
Database Setup
Understand the database schema
Production Checklist
Backup strategies and best practices
Kanban Board
View and manage imported tasks