I am trying to copy a MongoDB database from my (local) development machine to my (remote) test server.
When I am logged in to my test server, I do the following:
db.copyDatabase(“myDB”,”myDB”,xxx.xxx.xxx.xxx);
Where xxx.xxx.xxx.xxx is my external IP.
I get the error:
SyntaxError: missing ) after argument list (shell):1
Which doesn’t seem to make sense. I’ve tried adding an extra ) (although I was pretty sure that wasn’t actually going to solve it ) but funnily it gives exactly the same error. I’m totally stumped since it seems to make no sense.
The shell is getting confused when it sees the first decimal point (doesn’t know how to parse that as a parameter). You just need to wrap the IP address in quotes.