Creating tables again for Passwords

Hi,

in resetting the user password I deleted my mysql tables regarding the passwords app in strong believe it will be restored once I reinstall it.
This is not the case as errors ike “Table ‘nextcloud.oc_passwords_pw_tag_rel’ doesn’t exist” indicate.

My Idea was to create them manually again. For this I would need more info on how the tables need to be configured.

Do you have any ideas?

Best Regards

Josi

Maybe you can look in your last backup.
Also you can perhaps install a new (test) Nextcloud instance with the function and then dump the database. Maybe you can re-insert the part of the database in your normal Nextcloud.

1 Like

Yeah, if there is no command to issue this seems to be my last resort.

Thanks devnull!

Best Regards

Josi

Tables are created using migrations. Migrations are only executed once. If you have a recent version of the passwords app installed, you can use the following commands in the root directory of your Nextcloud installation to force the migrations to be executed again:

php ./occ config:system:set --type bool --value=true debug
php ./occ migrations:execute passwords 20220101
php ./occ migrations:execute passwords 20220102
php ./occ config:system:set --type bool --value=false debug

If you have no command line access to your server, you can try the app occweb and omit the php ./occ part.

Just executing the migrations might still not result in a working app as the passwords app also stores data elsewhere in the system. You can try php ./occ maintenance:repair to fix any other issues.
If the app still doesn’t work after that, run php ./occ passwords:backup:list to view previous backups and php ./occ passwords:backup:restore <backup name> to restore a working backup.

Then you can use php ./occ passwords:user:delete <internal user id> to delete the data of an user if that is what you wanted to archive originally