Make a root user to login to and then dump the database:
sudo -u postgres createuser -s $USER
pg_dump -U root -W -F t SPS1 > /[ ].tar
Create an sql-ledger user and root user to log in to:
createuser -d sql-ledger
sudo -u postgres createuser -s root
Create a temp database in webmin and then restore the database:
pg_restore --dbname=[ Temp DB name ] --create --verbose /[ ].tar
In ‘Webmin’ -> ‘PostgreSQL’ -> ‘Allowed Hosts’ ensure that 127.0.0.1/32 and ::1/128 are set to MD5 encrypted password.