[KDE-pim] New Install: AKONADI wit PostgreSQL

Ingo Klöcker kloecker at kde.org
Wed Dec 23 17:09:05 GMT 2020


On Mittwoch, 23. Dezember 2020 15:37:41 CET Hessler, Klaus-Michael wrote:
> Thanks @ All,
> 
> Martin Steigerwald wrote:
> > ... system wide PostgreSQL installation, a few other configuration
> > keys are needed. I think there is a documentation somewhere.
> 
> I tried hard, but I did not find any full description for a system wide
> PostgreSQL-Installation with AKONADI. I checked these pages:
> 
>   * Enrico Zini <https://www.enricozini.org/blog/2015/akonadi-install/>
>   * PrKos.hr
>     <https://prkos.hr/KOrganizer-and-Akonadi-Ubuntu-with-Postgres>:
>     KOrganizer and AKONADI and PostgreSQL
>   * Vinzenz Vietzke
>     <https://vinzv.de/en/bringing-kmail-and-postgresql-together/>: KMail
>     and PostgreSQL
> 
> Comparing these pages I found differences esp. with empty definitions in
> No. 7. This is the comparison and my schedule now:
> 
> 1. Install PostgreSQL
>     * OPEN (necessary?): install libQt5Sql5-postgresql [VV]

Yes, it's necessary. But it may not be necessary to install is explicitly.

>     * OPEN(necessary?): systemctl enable --now postgresql [VV]

It's necessary that the system postgres runs and is started automatically on 
system startup, if you want Akonadi to use it. Akonadi, being a user process, 
cannot start the system postgres.

> 2. Setup myself as PostgrSQL-user[VV] [Enrico Zini]:
>     # su - postgres
>     $ createuser <username>
>     $ psql postgres
>     postgres=# alter user <username> createdb;
>     postgres=# \q;
>     # exit
> 3. Transfer my actual databases (schemes / tables etc.)
> 4. Set up an additional database Akonadi using my regular user account
> [VV] [Enrico Zini]:
>     $ createdb Akonadi-<username>
> 5. Install akonadi-server akonadi-backend-postgresql [Enrico Zini] [PrKos]

What to install depends on your distribution. I'm using openSUSE and I didn't 
have to install something like "akonadi-backend-postgresql".

> 6. Stop Akonadi and remove settings (if any) [VV]:
>     $ akonadictl stop
>     $ rm -rf ~/.local/share/akonadi
> 7. Define connection to PostgreSQL-database "Akonadi", e.g. edit file
> ~/.config/akonadi/akonadiserverrc [VV]:
> [%General]
>     Driver=QPSQL
> 
>     [QPSQL]
>     Host=/tmp/Akonadi-<username>.hashOPEN: What means hash? Shall I keep
> the word or where to find the value?
>     Host= [PrKos] [Enrico Zini] OPEN: This version or the one above?

Host=

This should make Akonadi (resp. the postgres driver) look for the standard 
postgres socket.

>     InitDbPath=/usr/bin/initdb
> InitDbPath= [PrKos] [Enrico Zini] OPEN: This version or the one above?

I don't know. It may be irrelevant. /usr/bin/initdb is probably anyway used if 
nothing else is specified.

>     Name=Akonadi
>     Name=Akonadi-<username> [PrKos] [Enrico Zini] OPEN: This version or
> the one above?

I guess this depends on how many people are going to use the system postgres 
for Akonadi. If it's only you, then I don't see why using Akonadi-<username> 
as database name should be necessary. OTOH, using Akonadi-<username> is 
certainly not wrong.

>     Options=
>     ServerPath=/usr/bin/pg_ctl
> InitDbPath= [PrKos] [Enrico Zini] OPEN: This version or the one above?

Same as for InitDbPath.

>     StartServer=true
> StartServer=false [PrKos] [Enrico Zini] OPEN: This version or the one above?

StartServer=false

Akonadi probably wouldn't be able to start the system postgres. Moreover, 
unless Akonadi is the only user of the postgres server, then you certainly 
want postgres to be started on system startup. And then it makes no sense to 
tell Akonadi to start it because it's already running. In particular, this 
will probably also tell Akonadi, that it should not stop the server if Akonadi 
is shut down.

> The differences with the empty definitions (Host, ServerPath,
> InitDbPath) seem to be on purpose, ref. comment [PrKos]
>         Also the  Name (add username after akonadi).
>         After starting Akonadi service
>            $ akonadictl start
>         the configuration file reads with values for the empty
> definitions. OPEN: Can anybody confirm this?
> 8. Restart Akonadi [VV]:
>     $ akonadictl start
> 
> Any objections or different recommendations? Also I'd appreciate any
> response in regards to my lines marked with OPEN.

Note that my comments are based on how I think it should work. I have not 
actually tested this since I'm happy with using a standalone server for 
Akonadi on my single user systems.

> And what is the easiest way to check the setup, may I use KAlarm for this?

Not sure about this because I'm not sure that KAlarm still uses Akonadi. I 
somehow remember that KAlarm doesn't use Akonadi. KAddressBook definitely uses 
Akonadi.

Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdepim-users/attachments/20201223/4a066fbb/attachment.sig>


More information about the kdepim-users mailing list