JSOPanel Get started
Help Center › Administrators › A database says "that password did not work for this database" after a transfer

A database says "that password did not work for this database" after a transfer

A PostgreSQL or MongoDB database that arrived by transfer or restore refuses every password, and how to set it by hand.

After an account is transferred or restored, Adminer (or the website itself) says that password did not work for this database, and a password reset from the Databases page does not help. It affects PostgreSQL and MongoDB databases.

What it means

The data came across, but the database's own login was created without a password. The old password is still written in the account's credentials file and in the website's settings, and the database has never been told about it. Releases before this fix also had a second fault: Change password on a PostgreSQL or MongoDB database only changed a MariaDB login, said it had worked, and changed nothing real.

Steps

  1. Confirm the data arrived. PostgreSQL keeps it in the server's own data folder (/var/lib/postgresql/<version>/main), not in the account's files. Ask PostgreSQL instead of looking at files:
    sudo -u postgres psql -l
    sudo -u postgres psql -d DATABASE -c '\dt'
  2. Read the password the account has on record:
    sudo cat /home/ACCOUNT/.db_creds_postgresql_DATABASE
  3. Set it on the login. The password is typed at a hidden prompt, so it never appears in a command line or in the history:
    sudo -u postgres psql
    \password DATABASE
    Type the password from the previous step twice, then \q.
  4. Open Adminer from the Databases page again.
Tip: after upgrading, a transfer or restore sets the login's password from the account's credentials file by itself, and proves it by signing in. The transfer log then shows the login now accepts the password recorded for it. Changing the password from the Databases page now changes the real PostgreSQL or MongoDB login.