Skip to main content

Maintenance Mode

Some tasks need to be performed in maintenance mode, such as restoring database, resetting administrator password, etc. Below explains how to enter into this mode for different installation approaches.

Running as Docker Container

If you are running OneDev as docker container:

  1. Stop the container

  2. Run below command to enter into container:

    $ docker run -it --rm -v <data dir>:/opt/onedev <external database environment variables> 1dev/server bash 
    • <data dir> represents the directory storing OneDev data
    • In case using external database via environment variables, <external database environment variables> should be replaced by those environment variables you are used to start OneDev; otherwise just remove it
  3. Change into directory /opt/onedev in the container to perform various maintenance tasks

Running on Virtual Machine/Bare Metal

If you are running OneDev on virtual machine/bare metal:

  1. Stop OneDev service
  2. Change to the directory where OneDev is installed to perform maintenance tasks

Deploying to Kubernetes

If you are deplolying OneDev into Kubernetes cluster:

  1. Run below command to put OneDev into maintenance mode:

    $ helm upgrade onedev onedev --repo --namespace onedev --set maintenance=true --reuse-values
  2. Run command kubectl get pods -n onedev to check pod name of onedev

  3. Run below command to open a shell to OneDev server (replace <onedev-pod-name> with the actual pod name obtained in previous step):

    $ kubectl exec -it -n onedev <onedev-pod-name> bash
  4. Change to directory /opt/onedev in the container to perform various maintenance tasks

  5. After performing maintenance tasks, you may switch OneDev back to normal mode by running below command:

    $ helm upgrade onedev onedev/onedev --namespace onedev --set maintenance=false --reuse-values