You should generate a backup file before trying to update.
If you didn't create a backup and pihole -a -t is failing, there is no official way to create a backup.
The failed update attempt may have changed or destroyed your files, and it may not be possible to recover your settings.
Untested:
Please understand: from my point of view, your Pi-hole installation is broken beyond repair, but maybe there is a small possibility to "save" your configuration.
I can't guarantee this will be work.
Most Pi-hole v5 configuration is stored in /etc/pihole/.
This may not work in your case (Pi-hole v5.2.x to Pi-hole v6.4.2), but I found an old Pi-hole v5 to Pi-hole v5 attempt, where the user claims it was possible to install Pi-hole keeping the old config files.
Steps:
First manually copy all files from /etc/pihole (if you have advanced configuration files, also copy /etc/dnsmasq.d/).
Then install a new OS.
After that, create /etc/pihole using your backup.
Finally, install Pi-hole and hope the previous config files will be imported.
There is no guarantee this will work.