I have now solved the problem. I had to use 127.0.0.1 for the server name, instead of ‘localhost’.
However, you’re quite right that I did lose the configuration file, which is why I had to go through the configuration setup.
Fortunately, I do have a backup copy of my media directory.
Thanks for your help. I’ll be more careful next time!
James