usetania / tania-core

Tania is a farm management software for the hobbyist and smallholder farmer.

Home Page:https://usetania.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Database file is overwritten after server restart

bepitulaz opened this issue · comments

My steps when I got the bug:

  1. Built a binary from the source.
  2. Ran the binary as usual. I ran ./tania-core &. Then I filled Tania with data.
  3. Killed the pid.
  4. Changed redirect_uri in conf.json to another hostname.
  5. Ran the binary again with ./tania-core &.

Voiilaaa...the entire data was wiped out. I had to start from a clean slate again 😌

@bepitulaz Can you give me your conf.json values?

{
    "tania_persistence_engine": "sqlite",
    "demo_mode": true,
    "upload_path_area": "uploads/areas",
    "upload_path_crop": "uploads/crops",
    "sqlite_path": "db/sqlite/tania.db",
    "mysql_host": "127.0.0.1",
    "mysql_port": "3306",
    "mysql_dbname": "tania",
    "mysql_user": "root",
    "mysql_password": "root",
    "redirect_uri": "https://demo-tania.tanibox.com/",
    "client_id": "f0ece679-3f53-463e-b624-73e83049d6ac"
}

@bepitulaz If I saw your steps, you need to rebuild the frontend with npm run dev because you've changed the conf.json. The frontend reads the the conf.json when built.
But I'm not sure if that was the source of why the database was wiped.

Closed because cannot be reproduced