I created the new machine with privacyidea version 3.13, I imported the database from the old machine but I can’t upgrade the database. In the database of version 3.3 the alembic version table does not exist. I am going to create it but I don’t know what value I should put inside. I have already done dozens of tests but I can’t find the solution. Can someone help me?
Hello Gianluca,
Your database most likely needs to be stamped first before running the upgrade.
For older privacyIDEA installations, the alembic_version table often does not exist, especially on systems that were upgraded over many years. This is expected.
According to the official migration repository, the schema version for privacyIDEA 3.3 is:
a7e91b18a460
So the correct procedure is:
- Create the Alembic table manually:
CREATE TABLE alembic_version (
version_num VARCHAR(32) NOT NULL
);
- Stamp the database to the privacyIDEA 3.3 schema revision:
pi-manage db stamp a7e91b18a460
- Run the upgrade:
pi-manage db upgrade
Do not insert random revision numbers manually into the table.
The revision a7e91b18a460 is documented as the schema version for privacyIDEA 3.3 in the official migration repository.
https://github.com/privacyidea/privacyidea/tree/master/privacyidea/migrations/versions
Best regards
Julio
Thank you! It worked correctly!!!