Run the bulk import command as the mattermost user. Running it as root or any other user will cause issues with file permissions on imported attachments.
Make sure you have enough free space for logs on the Mattermost server as well as free space on the database server for both the database itself and transaction logs.
Disable anti-virus or any other plugins that might interfere with attachment uploading. They could potentially block uploading of attachments and cause the import to fail if configured incorrectly. If you need anti-virus scanning, scan the attachment folder before the import.