redis / ioredis

🚀 A robust, performance-focused, and full-featured Redis client for Node.js.
MIT License
14.06k stars 1.19k forks source link

Migrate command with target redis server using TLS #1874

Open marioanloru opened 3 months ago

marioanloru commented 3 months ago

Hi, I am migrating data from one redis serve to another one, both are configured to use TLS. How do I execute MIGRATE command to work with TLS redis servers? The command only does accept a host, port and password as auth

billnbell2 commented 2 months ago

What do you mean ? You just pass the items in the Redis connection.

  const config: RedisOptions = {
    port: Number(process.env.REDIS_PORT),
    host: process.env.REDIS_HOSTNAME,
    username: process.env.REDIS_USERNAME,
    keyPrefix: process.env.REDIS_KEY_PREFIX,
  };
  if (process.env.REDIS_TLS === 'true') {
    config.tls = {};
  }
  redis = new Redis(config);