Skip to content

Nature Recorder Transfer

Dave Walker edited this page Nov 10, 2026 · 3 revisions

ReefTag can transfer identified species from its image database into an existing Nature Recorder database. This provides a way to use ReefTag for visual identification and Nature Recorder for maintaining and analysing wildlife sighting records.

What Gets Transferred?

The command considers species identifications associated with images and folders whose observation date matches the date specified for transfer. Folders without an assigned location are excluded. It uses the identified species associated with those images to create Nature Recorder sightings:

Data Handling on Transfer
Locations Each folder’s location is matched by name, ignoring case, and created when missing
Categories Categories required by the species being transferred are matched by name, ignoring case, and created when missing
Species Existing Nature Recorder species are reused where their common and scientific names match and missing species are created under their corresponding category
Sightings One record is created for each distinct combination of species, location and date, unless that sighting already exists

ReefTag may contain several markers for the same species, perhaps across several images taken on the same day. These become one Nature Recorder sighting for each distinct species, folder location and date. The same species observed at different locations produces separate sightings.

The transfer does not provide an individual count so the new sighting's Number field is left empty. Image coordinates and annotation details are not transferred.

Before You Begin

  1. Install ReefTag and activate the Python environment used for the project - see Installation and Development Environment
  2. Ensure that both the ReefTag and Nature Recorder SQLite database files already exist
  3. Check that each species you want to transfer has an appropriate category assigned in ReefTag
  4. Check that the folders to be transferred have the correct date and location
  5. Make a backup of the Nature Recorder database before the transfer

Command-Line Options

Short option Long option Purpose Required?
-r --reeftag-db Path to the existing ReefTag SQLite database No, if REEFTAG_DB_PATH is set
-n --nature-recorder-db Path to the existing Nature Recorder SQLite database No, if NATURE_RECORDER_DB is set
-d --date Recording date of the ReefTag folders to transfer, in YYYY-MM-DD format Yes

Running the Transfer

From the ReefTag project directory, with its Python environment active, run:

python scripts/transfer.py \
  -r /path/to/reeftag.db \
  -n /path/to/nature-recorder.db \
  -d 2026-10-13

This example transfers identified species from folders dated 13th October 2026, recording sightings at each folder’s assigned location.

If the database paths aren't specified in the transfer command, they default to the values set in the following environment variables:

Database Environment Variable
Reef Tag REEFTAG_DB_PATH
Nature Recorder NATURE_RECORDER_DB

If those variables are set, and are correct for the required transfer, the command can be shortened to:

python scripts/transfer.py -d 2026-10-13

Location Matching

Locations are matched by name against the Locations table in Nature Recorder, using a case-insensitive comparison. Existing Nature Recorder records are used without updating their fields and new locations use these mappings:

ReefTag Field Nature Recorder Field
Name Name
Region County
Country Country
Latitude Latitude
Longitude Longitude

Categories and Species Matching

Categories

The transfer process checks the ReefTag categories required by the selected identifications against the Categories table in Nature Recorder. Existing categories are matched by name using a case-insensitive comparison and any missing categories are created automatically.

Species

The transfer process checks species against those already held in Nature Recorder, with matching performed across all species categories:

  1. Look for a matching common name
  2. If none is found, look for a matching scientific name
  3. If a species is found, both names must agree, ignoring differences in case
  4. If no species matches, create a new species in its corresponding Nature Recorder category

If a matching species has conflicting common or scientific names, the transfer stops with an error before any data is transferred.

How Sightings are Created

For each identified species on the chosen date, the command checks whether Nature Recorder already contains a sighting with the same:

  • Species
  • Location
  • Date

For the date check, the time is ignored so, for example, the following both count as the same date:

2026-10-19 00:00:00
2026-10-19 09:56:45

If a match exists, the command skips it rather than creating a duplicate so the transfer can safely be run again for the same date to transfer any new identifications across the assigned locations.

Checking the Result

The command logs species creations and matches, then reports the number of species and sightings created and existing sightings skipped. All destination changes are saved in one transaction; an error rolls back new locations, categories, species and sightings together.

The console output should be reviewed for any errors or unexpected skips, then Nature Recorder should be used to inspect the sightings for the selected date and folder locations.