StackExchange / StackExchange/StackExchange.Redis

KeyMigrate with authentication

Open
#2,463 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

⚙️ area:API ➕ enhancement
Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Can the KeyMigrate method be used against the target database with a password?
The migrate command supports AUTH option, but I didn't find it in the library.

Here is the code that I use

var source = ConnectionMultiplexer.Connect("127.0.0.1:6381");
var sourceDatabase = source.GetDatabase(5);
var sourceServer = source.GetServer("127.0.0.1", 6381);

var target = ConnectionMultiplexer.Connect("127.0.0.1:6379,password=my_password");
var targetEndPoint = target.GetEndPoints().Single();
await foreach (var key in sourceServer.KeysAsync(5))
{
    await sourceDatabase.KeyMigrateAsync(key, targetEndPoint, 5, 10000, MigrateOptions.Copy | MigrateOptions.Replace)
        .ConfigureAwait(false);
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the KeyMigrateAsync call shown in the issue and compare its available arguments with Redis’s MIGRATE command and AUTH option. Determine how a target password could be represented without disrupting the existing migration options; done means migration to the authenticated target in the example succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, redis
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.