I’m an idiot, I started using vikunja quite actively, and then started to make changes to my live instance. I swiftly broke it, and I’ve not been able to get it back to the same state. All my fault, I need to get better at sysadmining.
Normally at this stage I’d nuke and reinstall and learn a lesson, but I’d actually quite like to keep what I’d created in Vikunja this time around.
I’d correctly mapped my volumes, so I have a /db folder which appears to be complete.
If I just start a new instance of vikunja over the top of this one, it won’t let me log in - it’s not picking up the db entries.
Could someone please point me towards being able to ‘import’ this db into a new instance?
I used the simple Docker without any proxy example here:
Can you check if your db contains all data you entered in Vikunja?
To get a db shell in the container: docker-compose exec mysql -u root -p, then SHOW DATABASES to check if there even is a Vikunja DB. Select the db with use <DB>, and then check if the tables are present with SHOW TABLES. If there are tables check if they contain data. For example the tasks table: select * from tasks.
Since you’re hosting with docker you may want to check out my docker db backup tool:
it should not have overridden that. There might be additional info in the logs though. It’s also interesting there’s no database at all because usually there should be at least an internal mysql db. If really all data was nuked the db container would also create a new empty vikunja db when it starts again.
Did you check this as root?
Vikunja won’t create any data by itself so if you have any tasks or users these should be yours.
It’s probably more about SQL knowledge than the cli, you only need to know how the client works to get a shell into the db where you can run sql queries.
To get a shell: docker-compose exec mysql -u root -p vikunja. Then enter the password you set for the MYSQL_ROOT_PASSWORD env variable. The prompt should now look something like this:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 178223
Server version: 10.7.3-MariaDB-1:10.7.3+maria~focal mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
The -u root flag tells it to connect as the root user, the -p flag without any parameter tells it to ask for a password and vikunja as the last parameter tells it to directly select the vikunja database (that’s the same as running USE vikunja).
Next, check if you have any tables by running SHOW TABLES. Should looks something like this:
Then, to check if there are any tasks run SELECT * FROM tasks. For users run SELECT * FROM users (won’t be able to show you my output here since this is public and there is tasks from other people in there).
Either that or GitHub Sponsors (there’s a one time option there as well). If you have it set up I’d prefer GitHub Sponsors because of the lower fees.