Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create backup from server data #143

Open
MR-Os1 opened this issue May 25, 2023 · 2 comments
Open

Create backup from server data #143

MR-Os1 opened this issue May 25, 2023 · 2 comments
Labels
a:feature New feature or request

Comments

@MR-Os1
Copy link

MR-Os1 commented May 25, 2023

Is there a way to properly backup server's data to a file and restore it?
if it's not, how can we add it?

@MR-Os1 MR-Os1 added the a:feature New feature or request label May 25, 2023
@jmattheis
Copy link
Member

Yes, to back up all traggo data, you can copy the traggo database. All state is in there.

server/.env.sample

Lines 17 to 19 in b707a27

# the database connection string, differs depending on the dialect
# sqlite3: path/to/database.db
# TRAGGO_DATABASE_CONNECTION=data/traggo.db

@oslavq
Copy link

oslavq commented Jan 8, 2025

Traggo stores all of it's data in a .db (database) file, so backing it up yourself is pretty easy.

cd into traggo data location

make sure you got at least rx permissions for traggo.db and sqlite3 package installed on your system. Use these commands to create a database dump (it will contain all of the data from the database as SQL queries that can be later used to recreate the database)

cd /opt/traggo/data (for you, the folder might be in a different location)
sqlite3 traggo.db
.output dump_name.sql
.dump
exit the sqlite3 shell with Ctrl + C

now you will have a .sql file with all of your traggo data. You can view it as plain text with any text editor

You can find guides online on how to restore from a dump, so i won't write this down here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants