With this script, you can import multiple DirectAdmin backups and restore them all at once in HestiaCP. The script will process each DirectAdmin backup file one by one.
You can download and run the script using the commands below. If the ‘v-import-directadmin’ script is not already present in your installation, the script will automatically download it for you.
I tested the script througly, on multiple direct admin servers. But it is always important to make good backups.
The topic script is only a script that pulls the import script from the Hestiacp GitHub when you not have it already and has some coding to allow importing multiple files at once. Which the Hestiacp does not support natively.
When you run into issues, please let me know so I can fix them.
Hi, The script works perfectly for restoring the public_html folder and the database. It also restores the email accounts with the correct passwords. However, when I access Roundcube afterwards, I see the email count but no messages are visible. I have checked the file permissions and ownership, and they are correct. I also tried rebuilding the dovecot.index file but was unable to resolve the issue.
@Webmart, keep in mind that you can also configure Dovecot in Hestia to compress and decompress Maildir files, so you don’t need to decompress them in DirectAdmin, back them up, and then restore them in Hestia.
Example using zstd as the compression library:
Instal the required packages:
apt install zstd libzstd1 libzstd-dev
Edit file /etc/dovecot/conf.d/10-mail.conf and add this line to the end:
mail_plugins = zlib
Edit /etc/dovecot/conf.d/90-plugin.conf and add this inside the plugin directive:
zlib_save = zstd
zlib_save_level = 6
In context:
##
## Plugin settings
##
# All wanted plugins must be listed in mail_plugins setting before any of the
# settings take effect. See <doc/wiki/Plugins.txt> for list of plugins and
# their configuration. Note that %variable expansion is done for all values.
plugin {
#setting_name = value
zlib_save = zstd
zlib_save_level = 6
}
Restart dovecot and it should work:
systemctl restart dovecot
Note: Keep in mind that you must use the same compression library used in DirectAdmin. If you are using gz in DA, configure zlib_save = gz, the same for bz2 or lz4.