main
ROOT /
pages /
maintenance-mode.md
39 lines | ISO-8859-1 | 2 KB

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 flavors:

  • 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
    1. Change into directory /opt/onedev in the container to perform various maintenance tasks
  • If you are deplolying OneDev into Kubernetes cluster:

    1. Run below command to put OneDev into maintenance mode:
    $ helm upgrade onedev onedev --repo https://dl.cloudsmith.io/public/onedev/onedev/helm/charts --namespace onedev --set maintenance=true --reuse-values
    
    1. Run command kubectl get pods -n onedev to check pod name of onedev
    2. Run below command to open a shell to OneDev server (replace with the actual pod name obtained in previous step):
    $ kubectl exec -it -n onedev <onedev-pod-name> bash
    
    1. Change to directory /opt/onedev in the container to perform various maintenance tasks
    2. 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
    
  • If you are running OneDev on virtual machine/bare metal machine:

    1. Stop OneDev service
    2. Change to the directory where OneDev is installed to perform maintenance tasks
Please wait...
Page is in error, reload to recover