you should manually merge old and new config. Which version your upgrading? If you upgrading from 4.x to 5.0.x - this is major version change. If not - it can be a bug.
json: error: ENOENT: no such file or directory
try to run sudo dpkg-reconfigure onlyoffice-documentserver
sudo apt purge onlyoffice-documentserver
sudo rm -rf /var/www/onlyoffice
(cleanup all other stuff, not forget to backup)sudo rm -rf /etc/onlyoffice/documentserver
sudo apt install onlyoffice-documentserver