# Error when migrating to an external postgres instance

**URL:** <https://meta.discourse.org/t/error-when-migrating-to-an-external-postgres-instance/291992>\
**Category:** Self-hosting\
**Created:** [January 17, 2024, 8:19pm UTC](https://meta.discourse.org/t/error-when-migrating-to-an-external-postgres-instance/291992 "2024-01-17T20:19:24Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Morpheus636](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@Morpheus636](https://meta.discourse.org/u/Morpheus636)\
**Post date:** [January 18, 2024, 7:09pm UTC](https://meta.discourse.org/t/error-when-migrating-to-an-external-postgres-instance/291992/8 "2024-01-18T19:09:35Z")

</div>

Here you go! Everything I redacted is correct. The port is the only thing that is wrong.

```plaintext
[1] pry(main)> BackupRestore.database_configuration
=> #<struct BackupRestore::DatabaseConfiguration
 host="[REDACTED[",
 port=5432,
 username="[REDACTED]",
 password="[REDACTED]",
 database="[REDACTED]">
[2] pry(main)> BackupRestore::DatabaseRestorer.psql_command
=> "PGPASSWORD='[REDACTED]' psql --dbname='[REDACTED]' --single-transaction --variable=ON_ERROR_STOP=1 --host=[REDCATED] --port=5432 --username=[REDACTED]"

```

I’ll also reiterate that the blank instance _is_ able to connect to the database for everything except restoring from the backup.

---

_[View the full topic](https://meta.discourse.org/t/error-when-migrating-to-an-external-postgres-instance/291992)._
