# Timeout when restoring a backup

**URL:** https://meta.discourse.org/t/timeout-when-restoring-a-backup/170103
**Category:** Self-hosting
**Created:** [November 14, 2020, 7:18am UTC](https://meta.discourse.org/t/timeout-when-restoring-a-backup/170103 "2020-11-14T07:18:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mmcc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mmcc/32/147624_2.png) [@mmcc](https://meta.discourse.org/u/mmcc)
#### Post date: [November 14, 2020, 7:18am UTC](https://meta.discourse.org/t/timeout-when-restoring-a-backup/170103/1 "2020-11-14T07:18:17Z")

</div>

I’m working on migrating a decently large Discourse installation from a single instance (3 years going strong!) to managed Digital Ocean databases and separate frontends. Everything is fine for the initial installation once I boot up the new frontends, there’s a fresh, working installation of Discourse.

However, once I go to restore a backup, it always eventually fails while “restoring dump file”

```plaintext
...
[2020-11-14 04:56:16] Creating missing functions in the discourse_functions schema...
[2020-11-14 04:56:17] Restoring dump file... (this may take a while)
[2020-11-14 04:58:27] psql: error: could not connect to server: could not connect to server: Connection timed out
...

```

I’m pretty confused as to what could be happening here. The connection seems to be fine since Discourse otherwise works, and I don’t see anything in the DB logs or charts that would lead me to believe there’s a problem on that end of things.

Any ideas?

**Edit** : Just noticed something odd in the logs. In my config file the Postgres port is set to `25060`, but the logs talking about the timeout mention port `5432`.

```plaintext
[2020-11-14 18:20:23] Is the server running on host "[host]" ([ip]) and accepting
[2020-11-14 18:20:23] TCP/IP connections on port 5432?

```

Is it possible that the restore process isn’t respecting the configured port for some reason?

---

<div class="post-metadata">

### Author: ![mmcc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mmcc/32/147624_2.png) [@mmcc](https://meta.discourse.org/u/mmcc)
#### Post date: [November 16, 2020, 4:43am UTC](https://meta.discourse.org/t/timeout-when-restoring-a-backup/170103/2 "2020-11-16T04:43:59Z")

</div>

Ah nevermind, finally came across [this post](https://meta.discourse.org/t/how-to-move-from-standalone-container-to-separate-web-and-data-containers/29413/27), looks like I needed to set `DISCOURSE_BACKUP_DB_PORT`.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [December 16, 2020, 4:45am UTC](https://meta.discourse.org/t/timeout-when-restoring-a-backup/170103/3 "2020-12-16T04:45:16Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
