Restoring a package copies the configuration files from the backup archive. However, the Redis database that has been assigned during the backup may have been reassigned after the package has been removed. This is the reason why the restore script should probably look for a free database again during the restoration process. Examples from calckey (not maintained by me): https://github.com/YunoHost-Apps/calckey_ynh/blob/de4682ceca6ede7faeeb7f19bac32f24c9a65d14/scripts/restore#L33-L45