Fixed issue #2005 about splitting deploy of db in multiple chunks to avoid OOM