Migrating photos from an old (bad) MacOs

Hi! Any ideas on how to migrate/export photos from an old MacOs photos library to folders in order to have it organised in Endless Photos or Shotwell? It would be perfect if I could keep the original organisation of albums, but folders are not rationally organised in MacOs. A good day for all!