Mongo restore problem with indexes


#1

Hi,

I’m trying to restore production database dump locally.

Running:

mongorestore -h 127.0.0.1 --port 3001 -d meteor dump/www_meteorkitchen_com/

I got following error:

Error creating index meteor.users: 85 err: "Index with name: services.email.verificationTokens.token_1 already exists with different options"

This is output of db.indexes.find(), index services.email.verificationTokens.token_1 in both database:

Production db:

{
	"v" : 1,
	"name" : "services.email.verificationTokens.token_1",
	"key" : {
		"services.email.verificationTokens.token" : 1
	},
	"unique" : true,
	"ns" : "www_meteorkitchen_com.users",
	"safe" : true,
	"sparse" : 1
}

Local db:

{
	"v" : 1,
	"unique" : true,
	"key" : {
		"services.email.verificationTokens.token" : 1
	},
	"name" : "services.email.verificationTokens.token_1",
	"ns" : "meteor.users",
	"sparse" : 1
}

Any idea what to do?

Thanks!


#2

Hi,
what is stopping you from just dropping that local index before import ?
or running it with--noIndexRestore
It is in mongorestore documentation.
Thank you for using our forum google service.
Good luck.


#3

--drop option to mongorestore worked.

Thanks!