birdnet-pi2go
birdnet-pi2go copied to clipboard
BirdNET-Pi2Go is a data migration tool designed to facilitate the conversion of BirdNET-Pi database contents and audio files to the BirdNET-Go data model.
๐ฆ BirdNET-Pi2Go
๐ Overview
BirdNET-Pi2Go is a data migration tool designed to facilitate the conversion of BirdNET-Pi database contents and audio files to the BirdNET-Go data model. This utility ensures seamless transition between the two systems while maintaining your valuable bird detection data.
โจ Features
- ๐ Database Conversion: Migrates BirdNET-Pi SQLite database to BirdNET-Go format
- ๐ Audio File Transfer: Supports copying or moving audio recordings to BirdNET-Go directory structure
- ๐ Flexible Operations: Choose between copying files (preserving originals) or moving files (saving space)
- ๐พ Disk Space Verification: Automatically checks for sufficient storage before starting transfers
- โฉ Skip Audio Option: Option to migrate database only, without transferring audio files
- ๐ Merge Support: Ability to merge existing BirdNET-Go database with migrated data
๐ Requirements
- ๐ฅ๏ธ Go 1.21 or newer for building from source
- ๐ Access to BirdNET-Pi and BirdNET-Go file systems
๐ Getting Started
๐จ Building
To build BirdNET-Pi2Go from source:
git clone https://github.com/tphakala/birdnet-pi2go.git
cd birdnet-pi2go
go build
๐ Usage Guide
After building, run BirdNET-Pi2Go with various flags to customize your migration:
./birdnet-pi2go -source-db <path_to_birdnet_pi_db> -target-db <path_to_birdnet_go_db> -source-dir <path_to_birdnet_pi_audio_files> -target-dir <path_to_birdnet_go_audio_files> -operation <copy|move> -skip-audio-transfer <true|false>
๐๏ธ Command Options
| Flag | Description | Default |
|---|---|---|
-source-db |
Path to BirdNET-Pi SQLite database | birds.db |
-target-db |
Path to BirdNET-Go SQLite database (will be created) | birdnet.db |
-source-dir |
Path to BirdNET-Pi BirdSongs directory | (required for file transfer) |
-target-dir |
Path to BirdNET-Go clips directory | clips |
-operation |
File transfer mode: copy or move |
copy |
-skip-audio-transfer |
Skip audio file transfer (true or false) |
false |
โ ๏ธ Note: Target database should not exist - it will be created during migration.
๐งช Examples
Basic migration with file copying:
./birdnet-pi2go -source-db birds.db -target-db birdnet.db -source-dir ~/birdnetpi/BirdSongs -target-dir clips -operation copy
Migrate database only (no audio files):
./birdnet-pi2go -source-db birds.db -target-db birdnet.db -skip-audio-transfer true
Move files instead of copying (saves disk space):
./birdnet-pi2go -source-db birds.db -target-db birdnet.db -source-dir ~/birdnetpi/BirdSongs -target-dir clips -operation move
Merge existing databases:
./birdnet-pi2go -source-db birds.db -target-db birdnet.db -operation merge
๐ Data Handling
BirdNET-Pi2Go carefully preserves your detection data while converting between formats:
- ๐ Detection records are mapped to BirdNET-Go's Note structure
- ๐ Audio filenames are standardized according to BirdNET-Go conventions
- ๐๏ธ File organization follows BirdNET-Go's year/month directory structure
โ ๏ธ Disclaimer
This tool is provided 'AS IS', without warranty of any kind. Please ensure you have backed up your data before using this tool. The developers are not responsible for any loss of data.
๐ License
MIT