I’m using the official Docker image, and docker-compose to configure Nextcloud, reverse Nginx proxy, Letsencrypt, Nextcloud MariaDB instance and so on. Then I had the idea to move it all from my home folder to root’s home folder at /root because I don’t want those files changed easily, but I also want a friend of mine sharing the server to be able to change things. All well and good, but during the process my brain had the idea of “fixing” a “typo”.
So in my docker-compose I had
volumes:
- nextcloud:/var/www/nextcloud
- ./nextcloud/config:/var/www/nextcloud/config
- ./nextcloud/custom_apps:/var/www/nextcloud/custom_apps
- ./nextcloud/data:/var/www/nextcloud/data
- ./nextcloud/themes:/var/www/nextcloud/themes
- /etc/localtime:/etc/localtime:ro
and I changed the first line to
volumes:
- ./nextcloud:/var/www/nextcloud
Then I realized I probably mucked up my volume by doing that, so I changed it back. I still appear to have all my files, but when I go to the page I get the message that I’m using SQLite and to make an admin account, and install missing apps. So something got messed up with the database, but I don’t think I changed the database volume, though to be honest I don’t remember clearly if I did or not.
My MariaDB config:
volumes:
- db:/var/lib/mysql
- ./ncp-mysql.cnf:/etc/mysql/conf.d/ncp-mysql.cnf:ro
- /etc/localtime:/etc/localtime:ro
I don’t think I did
volumes:
- ./db:/var/lib/mysql
but maybe I did since it seems like the database is empty? If I start everything and do
docker exec -it nextcloud-mariadb mysql -uroot -p
and switch to the nextcloud database there, it is empty.
I only have an old backup from December of the database, I wonder if I should restore that and make it add the missing stuff? All the actual files are still intact, but the database seems gone. What would you do in this situation (except have proper backups, I know, and I’m stupid for not having set up that)?