Transfer tokens from privacyidea 3.9.3 to privacyidea 3.12.3

I’m new to admining privacyidea. We have a server running 3.9.3 and we are trying to upgarde to version 3.12.3. We tried to go the upgarde route with

pip install --upgrade privacyidea

but abandoned that after it was still working after 24+ hours. Now we have a new server running version 3.12.3 and we would like to be able to transfer the tokens and or data so that all the users don’t have to reinitialize they OTP. All users are using TOTP. Can this be done? The system using mariadb for the database.