improved export method with transaction support