Kimai itself offers the API for importing data.

The other option is the importer plugin.

Importing from Kimai v1

There is a dedicated chapter about migrating data from Kimai v1.

Importing customer

See the importer plugin documentation

Via Grandtotal

See the importer plugin documentation

Importing projects

See the importer plugin documentation

Importing timesheets

See the importer plugin documentation