Skip to content

Backup and Restore the Database

ehpersonal38 edited this page Apr 13, 2023 · 11 revisions

Backing up the database

Detection data is stored in an SQLite database called 'birds.db in the 'scripts' directory. At any time, you can download a copy (create a backup) of the database using the "Tools" > "File Manager" tool.

To download the database to your laptop, PC, smartphone, or tablet:

  1. Go to "Tools" image
  2. "File Manager" image
  3. Click the 'scripts' directory image
  4. Select the database image
  5. And finally, choose to download the database using the buttons to the right image

Note: here are some other files and directories you may want to backup.

~/BirdNET-Pi/birdnet.conf
~/BirdNET-Pi/apprise.txt
~/BirdNET-Pi/scripts/birds.db
~/BirdSongs/Extracted/By_Date
~/BirdSongs/Extracted/Charts

Restoring the database

Unfortunately, there is a bug in the "File Manager" that does not properly upload files. The current solution is to either use the command line (Linux and macOS users) or WinSCP (Windows users).Update: I found the bug and will have this fixed soon!

Linux and macOS users

To restore a database from a backed-up birds.db database:

scp /$HOME/Downloads/birds.db [email protected]:/home/pi/BirdNET-Pi/scripts/birds.db

Windows Users

  1. WinSCP will open with a login prompt. Enter the hostname of your pi, its username and password. and click Login.
    Screenshot 2023-04-11 111747

  2. If it's your first time connecting to the host it'll present a warning. Click yes.
    Screenshot 2023-04-11 111829

  3. The left side is your PC's directory and the right is your Pi's. On the Pi side, open the BirdNET-Pi directory
    Screenshot 2023-04-11 111918

  4. Open the scripts directory and find birds.db
    Screenshot 2023-04-11 112039

  5. Click and drag or copy/paste birds.db from your PC's directory to your Pi side.

imageimage