[TIMOB-10223] Handle external directory properly

Added code to handle external directory. Also make sure that if the db doesn't exist, don't copy.

https://jira.appcelerator.org/browse/TIMOB-10223