# Install and migrate temporal without helm chart

**URL:** <https://community.temporal.io/t/install-and-migrate-temporal-without-helm-chart/1662>\
**Category:** Community Support\
**Created:** [March 8, 2021, 11:05am UTC](https://community.temporal.io/t/install-and-migrate-temporal-without-helm-chart/1662 "2021-03-08T11:05:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![marimp8888](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/marimp8888/32/956_2.png) [@marimp8888](https://community.temporal.io/u/marimp8888)\
**Post date:** [March 8, 2021, 11:05am UTC](https://community.temporal.io/t/install-and-migrate-temporal-without-helm-chart/1662/1 "2021-03-08T11:05:07Z")

</div>

Hi,

we are planning to use temporal in our production environment but we have some costraints and so we probably need some suggestions about the correct approach.  
We cannot use kubernetes at the moment and so we are not able to use the provided helm chart.

Saying that, our idea is:

INSTALLATION:  
1 - install a separate postgres db (it will be use also for other purposes).  
2 - Install 3 nodes with docker-compose instances of temporal containing:  
- temporalio/auto-setup:${version} (this is configured to be connected to the existing DB)  
- temporalio/web:${version}  
The container “temporalio/admin-tools:${version}” should not be required in the installed nodes because it should be used only for db migration and cli “tctl”. Could you confirm this?

MIGRATION:  
this should be the approach:  
1 - Migrate DB: run a custom script (I shared it at the end of post) by using the desired “temporalio/admin-tools” version (TEMPORAL\_ADMIN\_TOOLS\_VERSION). This should be compatible with older server version  
2 - Rolling Update of docker-compose (server and web). This should be at 0 downtime

I’m trying to understand the limitations of this approach; for example I read that the “Archival is not supported when running Temporal via docker-compose”.

- Could you suggest a workaround for this?
- There are other limitations to the docker-compose approach?
- Have you got general guides or best practices or other solutions?

Great Thanks for your time and support  
Marco

#################################################################################  
#!/bin/bash  
export TEMPORAL\_ADMIN\_TOOLS\_VERSION=${TEMPORAL\_ADMIN\_TOOLS\_VERSION:-1.6.2}  
SCHEMA\_DIR=/etc/temporal/schema/postgresql/v96/temporal/versioned  
VISIBILITY\_SCHEMA\_DIR=/etc/temporal/schema/postgresql/v96/visibility/versioned

POSTGRES\_PWD=“${POSTGRES\_PWD:-temporal}”  
{ export SQL\_PASSWORD=$POSTGRES\_PWD; } 2\> /dev/null  
export DBNAME=“${DBNAME:-temporal}”  
export VISIBILITY\_DBNAME=“${VISIBILITY\_DBNAME:-temporal\_visibility}”  
export SQL\_USER=${POSTGRES\_USER:-temporal}  
export SQL\_PORT=${DB\_PORT:-5432}  
export SQL\_HOST=${POSTGRES\_SEEDS:-postgresql}  
export SQL\_PLUGIN=postgres

DOCKER\_PARAMS=“–env SQL\_PLUGIN --env SQL\_HOST --env SQL\_PORT --env SQL\_USER --env SQL\_PASSWORD --rm --network temporal-network -it --entrypoint /bin/bash temporalio/admin-tools:$TEMPORAL\_ADMIN\_TOOLS\_VERSION”

# UPDATE

echo “\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\> Update …”  
docker run $DOCKER\_PARAMS -c “temporal-sql-tool --db $DBNAME update-schema -d $SCHEMA\_DIR”  
docker run $DOCKER\_PARAMS -c “temporal-sql-tool --db $VISIBILITY\_DBNAME update-schema -d $VISIBILITY\_SCHEMA\_DIR”

#################################################################################

---

<div class="post-metadata">

**Author:** ![Wenquan\_Xing](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/wenquan_xing/32/362_2.png) [@Wenquan\_Xing](https://community.temporal.io/u/Wenquan_Xing)\
**Post date:** [March 8, 2021, 7:01pm UTC](https://community.temporal.io/t/install-and-migrate-temporal-without-helm-chart/1662/2 "2021-03-08T19:01:57Z")

</div>

> [@marimp8888](#):
>
> INSTALLATION:  
> 1 - install a separate postgres db (it will be use also for other purposes).  
> 2 - Install 3 nodes with docker-compose instances of temporal containing:
> 
> - temporalio/auto-setup:{version} (this is configured to be connected to the existing DB) - temporalio/web:{version}  
> The container “temporalio/admin-tools:${version}” should not be required in the installed nodes because it should be used only for db migration and cli “tctl”. Could you confirm this?

1 → looks good  
2 → use `temporalio/server`, not `temporalio/auto-setup` for you production env, and manually setup the db schema: ref: [https://github.com/temporalio/temporal/blob/v1.7.0/Makefile#L335](https://github.com/temporalio/temporal/blob/v1.7.0/Makefile#L335)

---

<div class="post-metadata">

**Author:** ![Wenquan\_Xing](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/wenquan_xing/32/362_2.png) [@Wenquan\_Xing](https://community.temporal.io/u/Wenquan_Xing)\
**Post date:** [March 8, 2021, 7:03pm UTC](https://community.temporal.io/t/install-and-migrate-temporal-without-helm-chart/1662/3 "2021-03-08T19:03:37Z")

</div>

archival is currently an experimental feature.

---

<div class="post-metadata">

**Author:** ![marimp8888](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/marimp8888/32/956_2.png) [@marimp8888](https://community.temporal.io/u/marimp8888)\
**Post date:** [March 8, 2021, 10:12pm UTC](https://community.temporal.io/t/install-and-migrate-temporal-without-helm-chart/1662/4 "2021-03-08T22:12:53Z")

</div>

Hi,  
I tried to follow your suggestion by replacing the docker-compose image auto-setup with **temporalio/server:1.7.0** but It seems that the server is not able to start due to:  
“Unable to start server: sql schema version compatibility check failed: dial tcp 10.252.64.2:5432: connect: connection refused.”

There is probably a missing configuration parameter. Have you got a description of the required environment variables used to connect to postgres db?

BTW: regarding the archival feature, what do you mean that it is experimental? is it possible to use it in my case or I need to wait an offical release (in this case, have you got a plan?)

This is my docker-compose section

##########################à  
temporal:  
container\_name: temporal  
depends\_on:  
- postgresql  
environment:  
- DB=postgresql  
- DB\_PORT=5432  
- POSTGRES\_USER=temporal  
- POSTGRES\_PWD=temporal  
- POSTGRES\_SEEDS=postgresql  
- DYNAMIC\_CONFIG\_FILE\_PATH=config/dynamicconfig/development.yaml  
image: temporalio/server:1.7.0  
networks:  
- temporal-network  
ports:  
- 7233:7233  
volumes:  
- ./dynamicconfig:/etc/temporal/config/dynamicconfig  
##########################à

Great Thanks  
Marco

---

<div class="post-metadata">

**Author:** ![Wenquan\_Xing](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/wenquan_xing/32/362_2.png) [@Wenquan\_Xing](https://community.temporal.io/u/Wenquan_Xing)\
**Post date:** [March 8, 2021, 10:53pm UTC](https://community.temporal.io/t/install-and-migrate-temporal-without-helm-chart/1662/5 "2021-03-08T22:53:01Z")

</div>

> [@marimp8888](#):
>
> dial tcp 10.252.64.2:5432: connect: connection refused.

could you try making sure `10.252.64.2` is the IP address of your PG setup, and can you verify that DB is ready by using psql?

---

<div class="post-metadata">

**Author:** ![marimp8888](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/marimp8888/32/956_2.png) [@marimp8888](https://community.temporal.io/u/marimp8888)\
**Post date:** [March 9, 2021, 11:21am UTC](https://community.temporal.io/t/install-and-migrate-temporal-without-helm-chart/1662/6 "2021-03-09T11:21:06Z")

</div>

Hi,  
the DB host seems to be correct but the issue I see is the strange behaviour:  
I firstly used the docker-compose file you provide [https://raw.githubusercontent.com/temporalio/docker-compose/v1.7.0/docker-compose-postgres.yml](https://raw.githubusercontent.com/temporalio/docker-compose/v1.7.0/docker-compose-postgres.yml) (it contains image “temporalio/auto-setup”) and all works fine.  
If I replace “temporalio/auto-setup” with “temporalio/server” (I tried both with and without environment variable “AUTO\_SETUP=true”) it fails with the postgres connection issue.

So I suppose that there are some differences between the two images that make the different behaviour.

Great Thanks  
Marco

---

<div class="post-metadata">

**Author:** ![marimp8888](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/marimp8888/32/956_2.png) [@marimp8888](https://community.temporal.io/u/marimp8888)\
**Post date:** [March 9, 2021, 2:49pm UTC](https://community.temporal.io/t/install-and-migrate-temporal-without-helm-chart/1662/8 "2021-03-09T14:49:43Z")

</div>

Hi,  
I understood the issue.  
I found a post in community related to the fact that by setting the environment variable AUTO\_SETUP=true to the temporalio/server its behaviour should be the same of auto-setup image.

I found in your [Dockerfile](https://github.com/temporalio/temporal/blob/master/Dockerfile) that auto-setup calls start.sh with **autosetup** parameter

```bash
FROM temporal-server AS temporal-auto-setup
CMD /start.sh autosetup

```

The autosetup calls the schema setup

```bash
auto_setup() {
    wait_for_db
    if ["$SKIP_SCHEMA_SETUP" != true]; then
        setup_schema
    fi

    if ["$SKIP_DEFAULT_NAMESPACE_CREATION" != true]; then
        register_default_namespace &
    fi
}

```

For this reason by using temporal/server in docker-compose, the postgres DB is not setup and it fails.

Do you know why the env variable **AUTO\_SETUP** was deprecated?

Great Thanks  
Marco

---

<div class="post-metadata">

**Author:** ![Wenquan\_Xing](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/wenquan_xing/32/362_2.png) [@Wenquan\_Xing](https://community.temporal.io/u/Wenquan_Xing)\
**Post date:** [March 9, 2021, 6:04pm UTC](https://community.temporal.io/t/install-and-migrate-temporal-without-helm-chart/1662/9 "2021-03-09T18:04:21Z")

</div>

1. I do not recommend using auto setup (automatic setting up DB schema or upgrading DB) for prod use case. DB schema upgrade is relative rare, and should be monitored.
2. AUTO\_SETUP env is not part of our public interface, in fact, the env is removed before 1.0: [Remove AUTO\_SETUP env var by markmark206 · Pull Request #752 · temporalio/temporal · GitHub](https://github.com/temporalio/temporal/pull/752)
