Restoring data from an available Yandex Managed Service for Valkey™ host
If you have an available Yandex Managed Service for Valkey™ host, you can copy its data to a self-hosted Valkey™ instance using replication. You can deploy this instance in a different availability zone or another cloud.
Prepare the cluster
To establish a connection, you need a Yandex Managed Service for Valkey™ cluster with TLS enabled and a public IP address assigned to the available host. Configure public access to this host.
Create a configuration file
Create a configuration file for the new Valkey™ instance:
replicaof <host_public_IP_address> 6380
tls-replication yes
tls-ca-cert-file /etc/valkey/tls/ca.crt
masteruser default
masterauth "<default_user_password>"
Specify the public IP address of the available host and the password for the source cluster default user.
Additional step. Obtain the CA certificate and save it to /etc/valkey/tls/ca.crt.
Note
TLS requirements. To initialize TLS in Valkey™, you also need a certificate and a private key for the new instance. Generate them using your preferred method and add them to the configuration:
tls-cert-file <path_to_certificate>
tls-key-file <private_key_path>
This requirement is described in the official Valkey™ guides
Deploy the new instance
Deploy Valkey™ using any preferred method. Use the same version as the source Yandex Managed Service for Valkey™ cluster and apply the configuration file you created.
Test replication
-
On the new instance, run the following command:
valkey-cli INFO replicationThe output must show the following values:
role:slave master_link_status:up -
On the source host, run
INFO replication. Connection note. To connect to a host with TLS and authentication, run this command:valkey-cli --tls \ -h <host_public_IP_address> -p 6380 \ --cacert /etc/valkey/tls/ca.crt \ --user default --askpass \ INFO replicationEnter the
defaultuser password. If the new instance is the only connected replica, the output will display:connected_slaves:1Note on the replica count. The
connected_slavesfield shows the total number of connected replicas. If the source already has replicas, this value will be greater than1. For more information, see theINFOcommand description .