Move repository on external disk / Best AiiDa setup?

Hello developers or veteran AiiDa users,

I have installed AiiDa on my personal laptop (MacOS M2) with a local database and a local repository.
As I am noticing my ever growing ~/.aiida/repository folder I wanted to know what would be the best way to move the repository to an external disk with more space without any major problem or loss of data.
More generally, what is the best way to install and work with AiiDa on a personal laptop with limited disk space and to be able to make backups easily ?

  • where is best for the database ?
  • where is best for the repository ?
  • where is best for the python environment ?

What are your suggestions and advice based on your expertise and experience ?

Hi @ValkScripter

where is best for the python environment

Here, the typical recommendation is to use a virtual environment. Either use a virtual environment provided for example by the venv module of Python itself or use Conda. But this is not very critical with respect to disk usage.

where is best for the repository

As you noticed, depending on your usage, this can quickly grow to be quite large. The main concern therefore is to have it in a place with plenty of space. The write/read speed is not that critical for performance so you typically can get away with a normal HDD but for optimal performance an SSD or comparable would of course be ideal. For an existing profile (default storage plugin core.psql_dos) the repository is just a folder on disk in the .aiida folder. You can find the location with verdi profile show. It should include the repository path:

(aiida-py311) sph@invader:~$ verdi profile show
Report: Profile: main
...
storage:
  backend: core.psql_dos
  config:
    database_engine: postgresql_psycopg2
    database_hostname: localhost
....
    repository_uri: file:///home/sph/.aiida/repository/main  <---- This path
test_profile: false

You can simply move that directory to a different (bigger) disk and then update this value in the .aiida/config.json file. That should be all.

where is best for the database

I am assuming that you are using the default profile which uses PostgreSQL. If you have a vanilla installation, the data will be somewhere on your local disk determined by PostgreSQL. It is possible to move this, but it is more complex. This has nothing to do with AiiDA though and is purely a PostgreSQL operation. You can google for tutorials on how to do this. The database is typically a lot smaller than the repository though, so this is often not the most pressing problem.

Thank you very much for your answer!
It seems to work fine.