Stop Vaultwarden inside container to restore?

Hey folks!

I’m just testing my backups and I’ve run into a bit of a snag. I am using the Google Cloud setup via this repository: GitHub - dadatuputi/bitwarden_gcloud: Bitwarden installation optimized for Google Cloud's 'always free' f1-micro compute instance

Things are working out great, I have rclone backup set up, and things are going swimmingly on that side. However, I am having trouble with restoring a backup.

The wiki recommends you restore while vaultwarden is stopped, but I have no clue how to stop the process. What I’m doing is running sh on the vaultwarden container: docker exec -it bitwarden sh and I can navigate around inside the container. I was able to download and unpack my tar.gz backup file, but changes were not captured on the web vault interface.

I suspect it’s because vaultwarden was still running in the container. Once I’m in the container, how can I stop and re-start vaultwarden?

Sorry if this is an elementary task. I tried ./vaultwarden stop but that didn’t seem to do the trick, and --help didn’t have much.

It strikes me that perhaps I am trying to restore at the wrong “level” and that perhaps what I should be doing is stopping the bitwarden container and restoring to the /var/lib/docker/volumes/ directory?

This was the ticket. I noticed that the docker-compose was reading from ${PWD}/bitwarden to derive the /data inside the container, so I went ahead and restored the data to that directory after stopping the container and it worked as expected.

1 Like