issue #1142 ExportToDatabase - fixed bug handling metadata in custom directory name w/o custom file names + test