What to backup
There are two parts you need to back up: The database and attachment files.
Since Vikunja 2.8.0, deleted tasks and projects go to the trash first. Users can restore them for 30 days. After that, or when someone deletes them from the trash, they are gone for good and only a backup can bring them back. Make sure you have a working backup strategy with appropriate retention periods.
Files#
To back up attachments and other files, it is enough to copy them from the attachments folder to some other place.
Database#
MySQL#
To create a backup from MySQL, use the mysqldump command:
mysqldump -u <user> -p -h <db-host> <database> > vikunja-backup.sql
You will be prompted for the password of the mysql user.
To restore it, simply pipe it back into the mysql command:
mysql -u <user> -p -h <db-host> <database> < vikunja-backup.sql
PostgreSQL#
To create a backup from PostgreSQL use the pg_dump command:
pg_dump -U <user> -h <db-host> <database> > vikunja-backup.sql
You might be prompted for the password of the database user.
To restore it, simply pipe it back into the psql command:
psql -U <user> -h <db-host> <database> < vikunja-backup.sql
For more information, please visit the relevant PostgreSQL documentation.
SQLite#
To back up SQLite databases, it is enough to copy the database file to somewhere else.