sheharyarn / mongo-sync

Sync Remote and Local MongoDB Databases :fire:
https://sheharyar.me/blog/sync-mongodb-local-and-production-heroku/
319 stars 89 forks source link

Windows Env #6

Open DonRichards opened 8 years ago

DonRichards commented 8 years ago

Works fine in OSX but when I try to run on my Windows 10 machine this is the error. I'm running git version 2.6.2.windows.1 w/ integrated git/unix commands

c:\... Github\mongo-sync > sh mongo-sync.sh pull

mongo-sync:
-----------
Are you sure you want to pull? Enter 'yes': yes
load_configs
Parsing 'config.yml'...
Success!

Dumping Remote DB to /tmp//dump...
Success!

Overwriting Local DB...
Error on or near line 148; exiting with status 1
Cleaning up...
sheharyarn commented 8 years ago

Could be an issue with unix-style $TMPDIR path on line 114. Could you try changing it to something more windows-like (such as C:\Users\<username>\AppData\Local\Temp\ or %Temp% - source) on your system and see if that works?

I don't have a windows machine on me so I can't test it. It would be awesome if someone could send in a pull-request that changes the $TMPDIR path depending on the env.

DonRichards commented 8 years ago

Even with

TMPDIR=C:\Users\Don\\AppData\Local\Temp\dump\
OR
TMPDIR=C:\Users\Don\\AppData\Local\Temp\dump\%local_db

it still throws same error.

flypart commented 5 years ago

my temporary solution: TMPDIR=./tmp/"$local_db"/dump

Maybe you can change "C:" to "/cygdrive/c/Users/..." if you installed cygwin