Migrating pg database and aiida profiles onto another machine

I am trying to migrate between machines. The old one has aiida 1.6.5 and the new 2.3.0.
I dumped the entire database with pg_dumpall in the old machine and restored it in the new machine with pq_restore. I copied the file repository and config.json to the new machine in placed them appropriately.

Now, I want to migrate each individual profile. I tried verdi -p aiidatutorial status, which migrated the config.json nicely, but resulted in the following error:

 ✔ version:     AiiDA v2.3.0
 ✔ config:      /home/dossan_f/.aiida
 ✔ profile:     aiidatutorial
 ✘ storage:     Unable to connect to profile's storage.
Error: UnreachableStorage: Could not connect to database: (psycopg2.OperationalError) connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL:  password authentication failed for user "aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7"
connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL:  password authentication failed for user "aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7"

(Background on this error at: https://sqlalche.me/e/14/e3q8)
 ✔ rabbitmq:    Connected to RabbitMQ v3.9.13 as amqp://guest:guest@127.0.0.1:5672?heartbeat=600
 ⏺ daemon:      The daemon is not running.

This might also be helpful:

postgres@mpc2976:~$ psql
psql (14.9 (Ubuntu 14.9-0ubuntu0.22.04.1))
Type "help" for help.

postgres=# \l
                                                                                  List of databases
                             Name                              |                        Owner                         | Encoding |   Collate   |    Ctype    |   Access privileges   
---------------------------------------------------------------+------------------------------------------------------+----------+-------------+-------------+-----------------------
 3dd_fdossantos_2a49dc116399a386b624747b9852c3d7               | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 FermiEnergyPaper_fdossantos_2a49dc116399a386b624747b9852c3d7  | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 FermiEnergy_fdossantos_2a49dc116399a386b624747b9852c3d7       | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 Mn2GeO4_fdossantos_2a49dc116399a386b624747b9852c3d7           | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 Mn5Si3_fdossantos_2a49dc116399a386b624747b9852c3d7            | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 QEvsSirius_fdossantos_2a49dc116399a386b624747b9852c3d7        | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 Tc_fdossantos_2a49dc116399a386b624747b9852c3d7                | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 aiida-ginestra_fdossantos_2a49dc116399a386b624747b9852c3d7    | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 aiidatutorial_fdossantos_2a49dc116399a386b624747b9852c3d7     | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 effective-mass_fdossantos_2a49dc116399a386b624747b9852c3d7    | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 jusong_fdossantos_2a49dc116399a386b624747b9852c3d7            | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 marnicks_tutorial_fdossantos_2a49dc116399a386b624747b9852c3d7 | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 postgres                                                      | postgres                                             | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 quicksetup_fdossantos_2a49dc116399a386b624747b9852c3d7        | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0                                                     | postgres                                             | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
                                                               |                                                      |          |             |             | postgres=CTc/postgres
 template1                                                     | postgres                                             | UTF8     | en_US.UTF-8 | en_US.UTF-8 | postgres=CTc/postgres+
                                                               |                                                      |          |             |             | =c/postgres
 tobe_metal_dossan_f_69dddbf4d03940392ec960c1be399c1f          | aiida_qs_dossan_f_69dddbf4d03940392ec960c1be399c1f   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 tobe_metal_fdossantos_2a49dc116399a386b624747b9852c3d7        | aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
(18 rows)

Thanks in advance for any help.

Seems the credential you have in your config.json for the PSQL user aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7 is no longer valid. You can try without AiiDA

psql -h localhost -d 3dd_fdossantos_2a49dc116399a386b624747b9852c3d7 -U aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7  -W

This will prompt for a password. Enter the one that is used in your config.json. I expect that this will also fail. In that case, you can try to reset the password in psql with

ALTER USER aiida_qs_fdossantos_2a49dc116399a386b624747b9852c3d7  WITH PASSWORD 'new_password';

Then try the psql command again to login. If it works, make sure to update your config.json and update the database_password with the new password you chose.

1 Like

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

Thanks, Sebastian. Changing the password did the job!

1 Like