There are two ways to restore a backup. You can either create a new cluster and intialise it
with a backup, specifying the fromBackup
section within
the YAML file (See Section 5.3.2, “Initializing using existing TungstenBackup” for details), or
you can use the kubectl tungsten commands as outlined below.
The following command will restore the latest backup available:
shell> kubectl tungsten cluster reset ClusterName DataSourceName
To specify a specific backup, just simple add the --backup
to
the above command, for example;
shell> kubectl tungsten cluster reset ClusterName DataSourceName
--backup MyBackupName
When you restore a cluster from a backup, the MySQL grants that were auto-generated upon cluster creation, including those for the root, application, and replicator users, along with their passwords, are overwritten. This can lead to a mismatch between the stored passwords in cluster's password secret and the actual passwords in use. To avoid this issue, it's currently recommended to bypass the use of auto-generated passwords and instead set up a custom password secret for production use. For guidance on how to do this, please refer to Section 3.2.2.2, “Configuring Custom Passwords”.
After restoring a cluster from a backup, it is currently required to manually reset the replicator on the restored primary node. This can be achieved by executing the following commands in the replicator container:
shell>trepctl offline
shell>trepctl reset -all -y
shell>trepctl online