1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430
|
# Examples and Use Cases
This guide provides practical examples for common Immich-Go scenarios.
## Quick Reference
| Scenario | Command | Documentation |
|----------|---------|---------------|
| [Upload local photos](#local-photo-upload) | `upload from-folder` | Basic photo upload |
| [Google Photos migration](#google-photos-migration) | `upload from-google-photos` | Takeout import |
| [iCloud import](#icloud-import) | `upload from-icloud` | iCloud takeout |
| [Server backup](#server-backup) | `archive from-immich` | Full server archive |
| [Server migration](#server-migration) | `upload from-immich` | Transfer between servers |
| [Photo organization](#photo-organization) | `stack` | Organize existing photos |
| [Selective sync](#selective-sync) | Various filters | Partial imports |
## Local Photo Upload
### Basic Upload
```bash
# Upload entire photo collection
immich-go upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
/home/user/Pictures
```
### Organized Upload with Albums
```bash
# Create albums from folder structure
immich-go upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
--folder-as-album=FOLDER \
--manage-raw-jpeg=StackCoverRaw \
/home/user/Pictures/Organized
```
### Tagged Upload
```bash
# Add custom tags and session tracking
immich-go upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
--tag="Import/2024" \
--tag="Source/LocalFiles" \
--session-tag \
/home/user/Pictures
```
### ZIP Archive Upload
```bash
# Upload from compressed archives
immich-go upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
/path/to/photo-archive.zip
```
## Google Photos Migration
### Complete Takeout Import
```bash
# Import all parts of a Google Photos takeout
immich-go upload from-google-photos \
--server=http://localhost:2283 \
--api-key=your-api-key \
--manage-raw-jpeg=StackCoverRaw \
--manage-burst=Stack \
/downloads/takeout-*.zip
```
### Selective Import
```bash
# Import only visible phtos and exclude partner photos
immich-go upload from-google-photos \
--server=http://localhost:2283 \
--api-key=your-api-key \
--include-partner=false \
--include-trashed=false \
/downloads/takeout-*.zip
```
### Album-Specific Import
```bash
# Import from specific album only
immich-go upload from-google-photos \
--server=http://localhost:2283 \
--api-key=your-api-key \
--from-album-name="Vacation 2023" \
/downloads/takeout-*.zip
```
### Large Takeout (Best Practices)
```bash
# Optimized for large takeouts (100k+ photos)
immich-go upload from-google-photos \
--server=http://localhost:2283 \
--api-key=your-api-key \
--concurrent-tasks=4 \
--client-timeout=60m \
--pause-immich-jobs=true \
--on-errors=continue \
--session-tag \
/downloads/takeout-*.zip
```
## iCloud Import
### Basic iCloud Import
```bash
# Import iCloud takeout
immich-go upload from-icloud \
--server=http://localhost:2283 \
--api-key=your-api-key \
--manage-heic-jpeg=StackCoverJPG \
/path/to/icloud-export
```
### iCloud with Memories
```bash
# Include iCloud memories as albums
immich-go upload from-icloud \
--server=http://localhost:2283 \
--api-key=your-api-key \
--memories \
--manage-heic-jpeg=StackCoverJPG \
/path/to/icloud-export
```
## Server Backup
### Complete Server Archive
```bash
# Backup entire Immich server
immich-go archive from-immich \
--server=http://localhost:2283 \
--api-key=your-api-key \
--write-to-folder=/backup/immich-complete
```
### Incremental Backup
```bash
# Backup only recent photos (last 30 days)
immich-go archive from-immich \
--server=http://localhost:2283 \
--api-key=your-api-key \
--from-date-range=$(date -d '30 days ago' '+%Y-%m-%d'),$(date '+%Y-%m-%d') \
--write-to-folder=/backup/immich-recent
```
### Album-Specific Backup
```bash
# Backup specific albums
immich-go archive from-immich \
--server=http://localhost:2283 \
--api-key=your-api-key \
--from-album="Family Photos" \
--from-album="Travel" \
--write-to-folder=/backup/immich-albums
```
### Yearly Archives
```bash
# Create separate archives by year
for year in 2020 2021 2022 2023 2024; do
immich-go archive from-immich \
--server=http://localhost:2283 \
--api-key=your-api-key \
--from-date-range=$year \
--write-to-folder=/backup/immich-$year
done
```
## Server Migration
### Complete Migration
```bash
# Transfer all photos between Immich servers
immich-go upload from-immich \
--from-server=http://old-server:2283 \
--from-api-key=old-api-key \
--server=http://new-server:2283 \
--api-key=new-api-key \
--concurrent-tasks=4
```
### Selective Migration
```bash
# Migrate specific date range
immich-go upload from-immich \
--from-server=http://old-server:2283 \
--from-api-key=old-api-key \
--from-date-range=2023-01-01,2023-12-31 \
--server=http://new-server:2283 \
--api-key=new-api-key
```
### Album Migration
```bash
# Migrate specific albums
immich-go upload from-immich \
--from-server=http://old-server:2283 \
--from-api-key=old-api-key \
--from-album="Family" \
--from-album="Work" \
--server=http://new-server:2283 \
--api-key=new-api-key
```
## Photo Organization
### Organize Existing Library
```bash
# Stack burst photos and RAW+JPEG pairs
immich-go stack \
--server=http://localhost:2283 \
--api-key=your-api-key \
--manage-burst=Stack \
--manage-raw-jpeg=StackCoverRaw \
--manage-heic-jpeg=StackCoverJPG
```
### Test Organization (Dry Run)
```bash
# Preview organization changes
immich-go stack \
--server=http://localhost:2283 \
--api-key=your-api-key \
--manage-burst=Stack \
--manage-raw-jpeg=StackCoverRaw \
--dry-run
```
### Folder Reorganization
```bash
# Reorganize messy folders into date-based structure
immich-go archive from-folder \
--write-to-folder=/organized-photos \
--manage-raw-jpeg=StackCoverRaw \
/messy/photo/folders
```
## Selective Sync
### Date Range Upload
```bash
# Upload photos from specific year
immich-go upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
--date-range=2023 \
/home/user/Pictures
```
### File Type Filtering
```bash
# Upload only videos
immich-go upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
--include-type=VIDEO \
/home/user/Movies
# Upload only specific image formats
immich-go upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
--include-extensions=.jpg,.png,.heic \
/home/user/Pictures
```
### Exclude Unwanted Files
```bash
# Skip large video files and screenshots
immich-go upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
--exclude-extensions=.mov,.mp4 \
--ban-file="*screenshot*" \
--ban-file="*Screen Shot*" \
/home/user/Pictures
```
## Performance Optimization
### High-Performance Upload
```bash
# Optimize for fast network and powerful server
immich-go upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
--concurrent-tasks=16 \
--client-timeout=30m \
--pause-immich-jobs=true \
/large/photo/collection
```
### Conservative Upload (Slow Network)
```bash
# Optimize for slow/unstable connection
immich-go upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
--concurrent-tasks=1 \
--client-timeout=120m \
--on-errors=continue \
/photos
```
### Background Processing
```bash
# Run upload in background with logging
nohup immich-go upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
--log-file=/tmp/upload.log \
--no-ui \
/photos > /dev/null 2>&1 &
```
## Automation Scripts
### Bash Script for Regular Backups
```bash
#!/bin/bash
# backup-immich.sh
set -e
IMMICH_SERVER="http://localhost:2283"
API_KEY="your-api-key"
BACKUP_DIR="/backup/immich"
DATE=$(date '+%Y-%m-%d')
echo "Starting Immich backup: $DATE"
# Create backup directory
mkdir -p "$BACKUP_DIR/$DATE"
# Backup recent photos (last 7 days)
immich-go archive from-immich \
--server="$IMMICH_SERVER" \
--api-key="$API_KEY" \
--from-date-range="$(date -d '7 days ago' '+%Y-%m-%d'),$(date '+%Y-%m-%d')" \
--write-to-folder="$BACKUP_DIR/$DATE" \
--log-file="$BACKUP_DIR/$DATE/backup.log"
echo "Backup completed: $BACKUP_DIR/$DATE"
```
### PowerShell Script for Windows
```powershell
# backup-immich.ps1
$ImmichServer = "http://localhost:2283"
$ApiKey = "your-api-key"
$BackupDir = "D:\Backup\Immich"
$Date = Get-Date -Format "yyyy-MM-dd"
Write-Host "Starting Immich backup: $Date"
# Create backup directory
New-Item -ItemType Directory -Path "$BackupDir\$Date" -Force
# Backup recent photos
& immich-go archive from-immich `
--server="$ImmichServer" `
--api-key="$ApiKey" `
--from-date-range="$(Get-Date (Get-Date).AddDays(-7) -Format 'yyyy-MM-dd'),$(Get-Date -Format 'yyyy-MM-dd')" `
--write-to-folder="$BackupDir\$Date" `
--log-file="$BackupDir\$Date\backup.log"
Write-Host "Backup completed: $BackupDir\$Date"
```
### Cron Job for Automated Backups
```bash
# Add to crontab: crontab -e
# Daily backup at 2 AM
0 2 * * * /home/user/scripts/backup-immich.sh
# Weekly full backup on Sundays at 3 AM
0 3 * * 0 immich-go archive from-immich --server=http://localhost:2283 --api-key=your-key --write-to-folder=/backup/weekly/$(date +\%Y-\%m-\%d)
```
## Troubleshooting Examples
### Debug Upload Issues
```bash
# Maximum debug information
immich-go --log-level=DEBUG --api-trace \
upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
--dry-run \
/test-photos
```
### Test Server Connection
```bash
# Verify server connectivity
immich-go --log-level=DEBUG \
archive from-immich \
--server=http://localhost:2283 \
--api-key=your-api-key \
--from-date-range=2024-01-01,2024-01-01 \
--write-to-folder=/tmp/test \
--dry-run
```
### Handle Large Files
```bash
# Upload large video files with extended timeout
immich-go upload from-folder \
--server=http://localhost:2283 \
--api-key=your-api-key \
--include-type=VIDEO \
--client-timeout=180m \
--concurrent-tasks=2 \
/large-videos
```
## See Also
- [Command Reference](commands/) - Detailed option documentation
- [Configuration Guide](configuration.md) - All configuration options
- [Best Practices](best-practices.md) - Performance and reliability tips
- [Technical Details](technical.md) - File processing information
|