-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
Complete reference for using Memoria to process social media exports.
| Task | Command |
|---|---|
| Process single export | ./memoria.py /path/to/export |
| Process with custom output | ./memoria.py /path/to/export -o /output |
| Process multiple exports | ./memoria.py --originals /path/to/parent |
| Process without upload | ./memoria.py /path/to/export --skip-upload |
| Upload only (no processing) | ./memoria.py /original --upload-only /processed |
| See available processors | ./memoria.py --list-processors |
| Enable verbose logging | ./memoria.py /path/to/export --verbose |
| Control parallelism | ./memoria.py /path/to/export --workers 8 |
| Process exports in parallel | ./memoria.py --originals /exports --parallel-exports 4 |
- Basic Usage
- Command-Line Options
- Processing Modes
- Output Organization
- Parallel Processing
- Immich Integration
- Environment Variables
- Advanced Usage
Process a single export directory:
./memoria.py /path/to/exportWith custom output directory:
./memoria.py /path/to/export -o /path/to/outputProcess multiple exports from a parent directory:
./memoria.py --originals /path/to/all-exports -o /path/to/outputThis will process all subdirectories in /path/to/all-exports that match supported formats.
Path to export (positional argument):
./memoria.py /path/to/exportOR
Multiple exports (using --originals):
./memoria.py --originals /path/to/parent-directory-o, --output PATH
Specify output directory for processed files. If not provided, defaults to ./output.
./memoria.py /path/to/export -o /path/to/output-v, --verbose
Enable verbose logging with DEBUG output and log file creation.
./memoria.py /path/to/export --verboseSee Logging for details.
-w, --workers N
Number of parallel workers for processing media files within a single export.
Default: CPU count - 1
./memoria.py /path/to/export --workers 8--parallel-exports N
Process N exports simultaneously when using --originals.
./memoria.py --originals /path/to/exports --parallel-exports 2See Parallel Processing for details.
--list-processors
List all available processors and exit.
./memoria.py --list-processors--skip-upload
Process files but don't upload to Immich (even if configured).
./memoria.py /path/to/export --skip-upload--upload-only PROCESSED_DIR
Skip processing and only upload previously processed files.
./memoria.py /path/to/original/export --upload-only /path/to/processed/outputSee Upload Only Mode for details.
--immich-url URL
Immich server URL (alternative to environment variable).
./memoria.py /path/to/export --immich-url https://immich.example.com--immich-key KEY
Immich API key (alternative to environment variable).
./memoria.py /path/to/export --immich-key your_api_key_here--immich-concurrency N
Number of concurrent uploads to Immich.
Default: 4
./memoria.py /path/to/export --immich-concurrency 8Memoria automatically detects which processors match your export structure:
./memoria.py /path/to/exportThe unified processor:
- Scans the input directory
- Identifies applicable processors based on directory structure
- Runs all matching processors
- Creates separate output directories for each processor
See which processors are available:
./memoria.py --list-processorsOutput example:
Available processors:
- GooglePhotosProcessor (priority: 100)
- GoogleChatProcessor (priority: 90)
- GoogleVoiceProcessor (priority: 85)
- DiscordProcessor (priority: 70)
- InstagramMessagesProcessor (priority: 80)
- InstagramPublicMediaProcessor (priority: 75)
- InstagramOldPublicMediaProcessor (priority: 70)
- SnapchatMemoriesProcessor (priority: 65)
- SnapchatMessagesProcessor (priority: 60)
Process exports separately from uploading:
- First: Process without uploading
./memoria.py /path/to/export -o /path/to/output --skip-upload- Later: Upload processed files
./memoria.py /path/to/export --upload-only /path/to/outputThis is useful for:
- Processing on one machine, uploading from another
- Processing multiple exports before uploading
- Re-uploading after Immich configuration changes
When processing a single export:
/path/to/output/
├── photos/ # If Google Photos found
│ └── processed files...
├── chat/ # If Google Chat found
│ └── processed files...
├── messages/ # If Instagram Messages found
│ └── conversations...
└── ...
Each processor creates its own subdirectory to prevent conflicts.
When using --originals:
/path/to/output/
├── google-user1-20250526/
│ ├── photos/
│ └── chat/
├── instagram-user2-20251007/
│ └── messages/
└── snapchat-user3-20251007/
├── memories/
└── messages/
Each export gets its own directory, maintaining the per-processor organization within.
Files are renamed to include metadata:
Format: {platform}_{username}_{original_filename}_{timestamp}.{ext}
Examples:
google-photos_john.doe_IMG_1234_20230115_103045.jpg
instagram_jane_doe_photo_20230220_142211.jpg
snapchat_user123_memory_20230310_151530.mp4
Control workers processing files within a single export:
./memoria.py /path/to/export --workers 8Higher values = faster processing but more CPU/memory usage.
Recommendations:
- Default (CPU count - 1): Good for most cases
- Lower (2-4): For systems with limited resources or during other tasks
- Higher (8-16): For powerful systems processing large exports
Process multiple exports simultaneously:
./memoria.py --originals /path/to/exports --parallel-exports 2This processes 2 exports at once, each using its own worker pool.
Recommendations:
- Sequential (default): Safest, lowest memory usage
- 2-3 parallel: Good balance for most systems
- 4+ parallel: Only for powerful systems with lots of RAM
See Parallel Processing for detailed guidance.
Configure Immich via environment variables in .env:
IMMICH_INSTANCE_URL=https://immich.example.com
IMMICH_API_KEY=your_api_key_here
IMMICH_UPLOAD_CONCURRENCY=4
IMMICH_IGNORE_PATTERNS=**/issues/**,**/needs matching/**Or via command-line arguments:
./memoria.py /path/to/export \
--immich-url https://immich.example.com \
--immich-key your_api_key_here \
--immich-concurrency 8- Log into your Immich instance
- Go to Account Settings > API Keys
- Click New API Key
- Give it a name (e.g., "Memoria")
- Copy the key and save it
Uploads are automatically organized into albums:
| Platform | Album Path |
|---|---|
| Discord | Discord/{username} |
| Google Photos | Google Photos/{username} |
| Google Chat | Google Chat/{username} |
| Google Voice | Google Voice/{username} |
| iMessage | iMessage/{device} |
| Instagram Messages | Instagram/{username}/messages |
| Instagram Posts | Instagram/{username}/posts |
| Snapchat Memories | Snapchat/{username}/memories |
| Snapchat Messages | Snapchat/{username}/messages |
Exclude certain files from upload using glob patterns:
IMMICH_IGNORE_PATTERNS=**/issues/**,**/needs matching/**,**/drafts/**Default patterns:
-
**/issues/**: Files in "issues" directories -
**/needs matching/**: Files needing manual review
See Immich Upload for details.
Create a .env file in the project root:
# Immich Configuration
IMMICH_INSTANCE_URL=https://immich.example.com
IMMICH_API_KEY=your_api_key_here
IMMICH_UPLOAD_CONCURRENCY=4
IMMICH_IGNORE_PATTERNS=**/issues/**,**/needs matching/**
# Processing Configuration
TEMP_DIR=../pre
DISABLE_TEMP_CLEANUP=0IMMICH_INSTANCE_URL
Your Immich server URL.
IMMICH_API_KEY
Your Immich API key.
IMMICH_UPLOAD_CONCURRENCY
Number of concurrent uploads (default: 4).
IMMICH_IGNORE_PATTERNS
Comma-separated glob patterns to exclude from upload.
TEMP_DIR
Directory for temporary preprocessing files (default: ../pre).
DISABLE_TEMP_CLEANUP
Set to 1, true, or yes to preserve temporary files after processing (useful for debugging).
Enable verbose logging and preserve temporary files:
DISABLE_TEMP_CLEANUP=1 ./memoria.py /path/to/export --verboseThis creates:
- Detailed log file in
logs/directory - Preserves temporary preprocessing data
- Shows DEBUG-level console output
Use a different location for temporary files:
TEMP_DIR=/mnt/fast-storage/temp ./memoria.py /path/to/exportUseful for:
- Using faster storage (SSD) for temp files
- Separating temp data from main storage
- Systems with limited space on default temp location
If you have a mixed export structure, you can process specific subdirectories:
# Process only Google Photos from a full Google Takeout
./memoria.py /path/to/google-export/Google\ Photos -o /path/to/outputProcess multiple exports with different settings:
#!/bin/bash
# Process each export with custom settings
./memoria.py /exports/google-user1-20250526 -o /output --workers 8
./memoria.py /exports/instagram-user2-20251007 -o /output --workers 4
./memoria.py /exports/snapchat-user3-20251007 -o /output --workers 6
# Upload all at once
./memoria.py /exports --upload-only /outputUse --list-processors with verbose mode to see detection:
./memoria.py /path/to/export --list-processors --verboseWhile there's no formal dry-run mode, you can:
- Process with
--skip-uploadfirst - Review the output
- Delete and reprocess if needed
- Workers: Start with default, increase if CPU usage is low
-
Temp Directory: Use SSD storage for
TEMP_DIRif available - Upload Concurrency: Increase for faster uploads if network can handle it
- Parallel Exports: Only use if you have sufficient RAM (2-4 GB per export)
- Disk Space: Ensure 2x the export size is available for temporary files
# 1. List processors to verify detection
./memoria.py /path/to/export --list-processors
# 2. Process with verbose logging
./memoria.py /path/to/export -o /output --verbose
# 3. Review output and logs
ls -R /output
cat logs/memoria_*.log# Process all exports in parallel
./memoria.py --originals /all-exports -o /output --parallel-exports 2# Process everything first
./memoria.py --originals /exports -o /output --skip-upload
# Review and organize output
# ...
# Upload when ready
./memoria.py /exports --upload-only /output- Getting Started - Initial setup guide
- Logging - Logging configuration and verbose mode
- Parallel Processing - Parallel processing guide
- Upload Only Mode - Upload-only mode details
- Upload Queuing - Upload queuing for parallel processing
- Immich Upload - Immich upload configuration
- Google Export - Google-specific guide
- iMessage Export - iMessage-specific guide
- Discord Export - Discord-specific guide
- Instagram Export - Instagram-specific guide
- Snapchat Export - Snapchat-specific guide