TeamPass icon indicating copy to clipboard operation
TeamPass copied to clipboard

Importing from KeePass failing

Open mick19955 opened this issue 3 months ago • 4 comments

Hello

Im trying to migrate our companies passwords from KeePass towards Teampass, but importing them fails/stalls.

Whenever i try to import a vault from KeePass to Teampass the importing gets stuck on the following message "Reading file" Image

I've edited the config to allow for larger than 10mb files, so thats not the issue. I've also tried with smaller files, giving me the same issue

Image

Any idea what i can do to fix this? Id like to avoid having to import the CSV's since that has already caused me a lot of trouble due to the contents of the comments and passwords

Teampass version:

Image

mick19955 avatar Sep 30 '25 13:09 mick19955

I assume, that you use apache webserver? Please check the logs of the webserver. Most of the time there you will find the error.

edit: you can post the error here if you need more help ;)

Sky-W-ui avatar Oct 01 '25 06:10 Sky-W-ui

[Wed Oct 01 07:23:05.222084 2025] [php:error] [pid 146789] [client 10.15.254.63:61156] PHP Fatal error: Uncaught TypeError: base64_encode(): Argument #1 ($string) must be of type string, null given in /var/www/html/teampass/sources/import.queries.php:997\nStack trace:\n#0 /var/www/html/teampass/sources/import.queries.php(997): base64_encode()\n#1 /var/www/html/teampass/sources/import.queries.php(965): buildItemDefinition()\n#2 /var/www/html/teampass/sources/import.queries.php(939): handleEntries()\n#3 /var/www/html/teampass/sources/import.queries.php(1065): recursive()\n#4 {main}\n thrown in /var/www/html/teampass/sources/import.queries.php on line 997, referer: https://teampass.qliro.com/index.php?page=import

This seems to be the error showing up in the logs when importing :)

mick19955 avatar Oct 01 '25 07:10 mick19955

From your error it seems, that the value in base64_encode isnt a string but a null. i dont know how good you are with changing code. But you can test this: Open this file: /var/www/html/teampass/sources/import.queries.php On Line 997 you should have this line: $itemDefinition['Password'] = base64_encode($itemDefinition['Password']) ?? ''; Change this line to: $itemDefinition['Password'] = base64_encode($itemDefinition['Password'] ?? ''); save the file and try the import again. this should change a null to an empty string which can be process by bas64_encode

Sky-W-ui avatar Oct 02 '25 11:10 Sky-W-ui

Thanks for the reply!

I managed to fix it in the meantime, with something along the line of what you suggested, which then gave me the issue that the passwords got imported into a non-existing folder, and a couple of tweaks later got it working!

mick19955 avatar Oct 02 '25 11:10 mick19955