Restore just the .sql files from multiple DirectAdmin tar.gz backups
Last Modified: Jan 23, 2018, 10:05 pm
Say you have a large list of files in: /home/admin/admin_backups
and you wish to restore the databases from those backups, but not the rest of the data, you can use this script for a quick restore.
This restore will not restore the mysql.user nor mysql.db tables. Only the username_db databases.
This will overwrite any current tables in the existing databases.
The DBs must already exist, as the .sql files do not contain the CREATE DATABASE commands, only drop/create tables, with the loading of the data.
as it processes each tar.gz file, that tar.gz will be moved to the "done" folder, so you can run it multile times, or stop it ad resume later if needed.
A sample script that can do this, might look like this: