Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. Transfer DB to Kubernetes

Transfer DB to Kubernetes

Added by Daniel Elkeles 10 months ago

We are trying to transfer our instance from a docker-compose install to kubernetes / helm-chart. The documentation on restoring does not mention the helm-install and we are unsure of how to import the DB-dump into the postgres-pod(s). Do you have any suggestions and if so, would it make sense to add this to the documentation?


Replies (1)

RE: Transfer DB to Kubernetes - Added by Tizian Rößler 9 months ago

Hi Daniel,

Restoring helm chart is almost the same as restoring the backup for docker compose.

https://www.openproject.org/docs/installation-and-operations/operation/restoring/#using-docker-compose

First step would be to install OpenProject on Kubernetes.
After that you can use the docker compose steps but would need to use the kubectl instead of docker-compose command.

So you would stop the web and worker container first:

kubectl scale deployment  --replicas=0 -n openproject openproject-worke
kubectl scale deployment  --replicas=0 -n openproject openproject-worker-default

After that you can drop the existing database:

kubectl exec -it -n openproject openproject-postgresql-0 -- psql -U postgres -c 'drop database openproject;'

this command will ask you for the password of the postgres user if you don't know it you should be able to get it with this command:

kubectl get secret -n openproject openproject-postgresql -o json |jq -r '.data."postgres-password"' |base64 --decode && echo

Now you can recreate the database:

kubectl exec -it -n openproject openproject-postgresql-0 -- psql -U postgres -c 'create database openproject owner openproject;'

Now copy the openproject.sql to the postgres container:

kubectl cp -n openproject openproject.sql openproject-postgresql-0:/tmp

Then you can open the database console:

kubectl exec -it -n openproject openproject-postgresql-0 -- psql -U openproject

Here we use the openproject user so you need to use a different password this can be found here:

kubectl get secret -n openproject openproject-postgresql -o json |jq -r '.data.password' |base64 --decode && echo

In the database console you need to add the following commands:

\c openproject
\i /tmp/openproject.sql

Now you can run the helm upgrade command again this will that start the seeder to migrate the database:

helm upgrade --create-namespace --namespace openproject --install openproject openproject/openproject

Best regards

Tizian

  • (1 - 1/1)
Loading...