create alist of folders and build the DB in the right structure