Skip to content

Management Commands ​

AdventureLog includes command-line tools for maintenance that the app doesn't do on its own. Run them inside the backend container:

bash
docker compose exec app python3 manage.py <command> [options]
bash
docker compose --env-file .env.advanced -f docker/docker-compose.advanced.yml exec server python3 manage.py <command> [options]

Commands that change data have a dry run. Use it first, and back up before applying changes.

Accounts ​

CommandWhat it does
changepassword <username>Sets a new password for a user, such as a locked-out admin
createsuperuserCreates another admin account

World data ​

CommandWhat it does
download_countriesImports the country, region, and city data. Runs on first boot unless SKIP_WORLD_DATA=1. Needs about 2 GB of RAM.
download_countries --forceDownloads the data again even if it's already there
sync_visited_regionsMarks the regions and cities of everyone's visited locations as visited. This also runs every night.

sync_visited_regions takes --dry-run, --user-id ID, --batch-size N, and --verbose. Staff can also run it for their own account under Settings → Admin → Update Visited Regions.

Territories ​

Since v0.14, places that the world data lists twice (Puerto Rico as a country and as a US region, for example) are filed under the territory's own country. See World Travel. Two commands tidy up locations saved before then:

CommandWhat it does
reassign_territory_locationsLists locations filed under the larger country that belong to a territory. Add --apply to move them. Visited regions and cities follow.
fix_location_countriesLists locations whose country disagrees with their region or city, which older backup imports could cause. Add --apply to fix them.

Both use the stored world data only and make no geocoding requests. Without --apply they change nothing.

Photos and files ​

CommandWhat it does
backfill_image_coordinatesStores GPS coordinates for photos uploaded before AdventureLog read them, so they appear on maps with Photo locations turned on
image_cleanupLists stored files that no location or collection uses, and asks before deleting them. --dry-run only lists them.

backfill_image_coordinates reads each photo's EXIF data, then falls back to the linked Immich photo if there is one. Photos converted to WEBP may have lost their EXIF data. Options:

OptionPurpose
--dry-runShow what would be updated without saving
--user-id IDOnly one user's photos
--batch-size NHow often to log progress (default 100)
--forceRead coordinates again even when they're already stored
--verboseLog each photo

Activities ​

CommandWhat it does
activity_elevation_fixMeasures elevation gain, loss, high, and low again from each activity's stored track, with the method new uploads use. Activities imported from Strava or Endurain are skipped, because their totals came from the recording device. Takes --dry-run, --activity-id UUID, and --force to include imported activities.