ALIBABA CLOUD → STACKIT · GUIDE

ApsaraDB Redis and MongoDB migration to STACKIT

An ApsaraDB for Redis instance becomes a STACKIT Key Value Store (Valkey) instance, classified RECONFIGURE: the application changes its endpoint and credentials, and the data is copied key by key. ApsaraDB for MongoDB becomes MongoDB Flex, classified REPLATFORM: the data moves with a dump and restore. The Memcache variant of the Alibaba Cloud cache service is the exception and needs its own decision.

The migration in order

Eight steps for an estate with a cache, a session store and a document database. Steps 1 to 3 come from the assessment, the rest are rehearsals that you run against your own data.

  1. 1. Read instance_type and engine_version

    In the kvstore resource, instance_type says Redis or Memcache; this estate has one of each, with engine_version 7.0 and 4.0. A Memcache instance is not a Redis instance, so sort them before anything else.

  2. 2. List the commands your code uses

    The run's reason for Redis says to confirm that no Tair-specific commands are in use. Search the application for module commands before you rely on a Valkey target.

  3. 3. Take the MongoDB version and replica size from the source

    The mongodb resource carries engine_version, db_instance_class, db_instance_storage and replication_factor. They are the inputs to the MongoDB Flex flavor you size by hand.

  4. 4. Create the empty targets

    STACKIT asks for a Key Value Store target with equal or greater RAM, storage and nodes than the source. Create credentials before any copy.

  5. 5. Copy the Redis keys

    STACKIT documents a key-by-key copy with the MIGRATE command, about 50 seconds per GB as a rough guide, and a check that compares INFO KEYSPACE and a sorted key list on both sides.

  6. 6. Dump and restore MongoDB

    Download a logical backup or run mongodump against the source, then restore with mongorestore into the Flex instance. Rehearse it first and time it.

  7. 7. Switch the applications

    Both targets have new endpoints and new credentials. STACKIT's tutorial connects to Key Value Store with TLS (the --tls flag, or --cacert where the SwissSign CA is not trusted), so check the connection scheme and CA trust of every client.

  8. 8. Keep the source until the checks pass

    STACKIT's tutorial says the source backup must be kept until the consistency of the target is confirmed, and no data goes into the target before the checks are done. Apply the same rule to MongoDB.

What the run records for each resource

From the run on the estate below. Targets and classes are the run's; the right column is what your team does.

Alibaba Cloud resourceClass and STACKIT targetWhat your team does
alicloud_kvstore_instance.sessions (Redis 7.0)RECONFIGURE, MEDIUM: STACKIT Key Value Store (Valkey)Copy keys with MIGRATE, switch endpoint and credentials, test TLS
alicloud_kvstore_instance.cache (Memcache 4.0)RECONFIGURE, MEDIUM: STACKIT Key Value Store (Valkey), with the Redis reasonDecide by hand: Key Value Store is Valkey, a Redis-compatible store, and not a Memcache service
alicloud_mongodb_instance.catalog (6.0, replication_factor 3)REPLATFORM, MEDIUM: STACKIT MongoDB FlexSize a flavor, dump and restore, check indexes after the restore
alicloud_vpc and alicloud_vswitchRECONFIGURE, MEDIUM: STACKIT networkCreate the networks first; all three data services follow in wave 3

The data-movement file lists all three database units with the mechanism UNKNOWN. Choosing it is part of the plan, not something the run does.

Two Redis-family instances, assessed

A small Alibaba Cloud estate written for this page and assessed by StackToIT on 4 November 2026. Left: the input. Right: the result StackToIT recorded for it, an excerpt of assessment.json with the values exactly as the run wrote them. assessment.json is written as a single line, so the pane shows selected fields of each unit, indented and nested as in the file, with the values unchanged.

Example inputmain.tf
resource "alicloud_kvstore_instance" "sessions" {
  db_instance_name = "shop-sessions"
  instance_class   = "redis.master.small.default"
  instance_type    = "Redis"
  engine_version   = "7.0"
  vswitch_id       = alicloud_vswitch.data.id
  security_ips     = ["10.80.0.0/16"]
}

resource "alicloud_kvstore_instance" "cache" {
  db_instance_name = "shop-cache"
  instance_class   = "memcache.master.small.default"
  instance_type    = "Memcache"
  engine_version   = "4.0"
  vswitch_id       = alicloud_vswitch.data.id
}
StackToIT assessmentassessment.json
[
  {
    "id": "alicloud_kvstore_instance.sessions",
    "result": {
      "class": "RECONFIGURE",
      "confidence": "MEDIUM",
      "target": {
        "service": "STACKIT Key Value Store (Valkey)"
      },
      "reason": "An ApsaraDB for Redis instance becomes a Valkey instance. The application changes its endpoint and credentials; confirm that no Tair-specific commands are in use."
    }
  },
  {
    "id": "alicloud_kvstore_instance.cache",
    "result": {
      "class": "RECONFIGURE",
      "confidence": "MEDIUM",
      "target": {
        "service": "STACKIT Key Value Store (Valkey)"
      },
      "reason": "An ApsaraDB for Redis instance becomes a Valkey instance. The application changes its endpoint and credentials; confirm that no Tair-specific commands are in use."
    }
  }
]
  • Same class, same reason

    The Memcache instance gets the same class, target and Redis reason as the Redis instance. Read it as a reminder to check, not as a statement that Memcache clients will work.

  • Endpoints and credentials change

    The reason says the application changes its endpoint and credentials. Plan the secret rollout together with the data copy.

  • Eviction before DTS

    Alibaba Cloud's DTS precheck requires the destination eviction policy noeviction. Check the policy on any target that DTS writes to.

  • Persistence is a target setting

    STACKIT describes snapshots (RDB) and append-only files (AOF) for Key Value Store. Decide whether session data needs them.

A MongoDB replica set, assessed

From the same run. Left: the input. Right: the assessment excerpt, followed by the data-movement rows that list the three database units. assessment.json is written as a single line, so the pane shows selected fields of each unit, indented and nested as in the file, with the values unchanged.

Example inputmain.tf
resource "alicloud_mongodb_instance" "catalog" {
  name                = "shop-catalog"
  engine_version      = "6.0"
  db_instance_class   = "mdb.shard.2x.large.d"
  db_instance_storage = 100
  replication_factor  = 3
  storage_engine      = "WiredTiger"
  vswitch_id          = alicloud_vswitch.data.id
  security_ip_list    = ["10.80.0.0/16"]
}
StackToIT assessmentassessment.json
{
  "id": "alicloud_mongodb_instance.catalog",
  "result": {
    "class": "REPLATFORM",
    "confidence": "MEDIUM",
    "target": {
      "service": "STACKIT MongoDB Flex"
    },
    "reason": "ApsaraDB for MongoDB becomes MongoDB Flex. Data moves with a dump and restore, and the instance class becomes a Flex flavor.",
    "axes": {
      "feasibility": "SUPPORTED",
      "motion": "REPLATFORM",
      "change_types": [
        "CONFIG",
        "DATA"
      ]
    }
  }
}
Data movementmigration/data-movement.md
| Unit | Source service | Target service | Application | Mechanism | State | Data class | RPO | Downtime tolerance |
|---|---|---|---|---|---|---|---|---|
| alicloud_kvstore_instance.cache | alicloud_kvstore_instance | STACKIT Key Value Store (Valkey) |  | UNKNOWN | DECISION_REQUIRED | NOT_PROVIDED | NOT_PROVIDED | NOT_PROVIDED |
| alicloud_kvstore_instance.sessions | alicloud_kvstore_instance | STACKIT Key Value Store (Valkey) |  | UNKNOWN | DECISION_REQUIRED | NOT_PROVIDED | NOT_PROVIDED | NOT_PROVIDED |
| alicloud_mongodb_instance.catalog | alicloud_mongodb_instance | STACKIT MongoDB Flex |  | UNKNOWN | DECISION_REQUIRED | NOT_PROVIDED | NOT_PROVIDED | NOT_PROVIDED |
  • Dump and restore, as the run says

    The reason names a dump and restore and a Flex flavor in place of db_instance_class. The mechanism column stays UNKNOWN until a person chooses.

  • Feature check on the source side

    Alibaba Cloud's backup download leaves out the system databases admin, local and config, system.* collections, views and time-series collections, and works only for cloud-disk replica sets and sharded clusters (local disks up to MongoDB 4.2). Users, roles and views have to be re-created on the target.

  • Unencrypted backups only

    For cloud-disk instances the download page lists unencrypted backup data as a prerequisite. If your backups are encrypted, or the instance type cannot download backups, run mongodump against the source instead.

  • Restore needs a matching client

    Alibaba Cloud's restore guide asks for a MongoDB client version that matches the source and a merge step for BSON files before mongorestore.

Decisions the architect owns

  • Memcache or Valkey

    If an instance is Memcache, choose between changing the client to a Redis-compatible protocol or running a Memcache-compatible service yourself.

  • Downtime for the Redis copy

    STACKIT's tutorial isolates the source first so that no client writes during the MIGRATE copy. Alibaba Cloud's full-only DTS task gives the same warning. Agree the write freeze with the application owners.

  • MongoDB flavor and storage class

    The run names MongoDB Flex but no flavor. Start from the source values, db_instance_class mdb.shard.2x.large.d, 100 GB of storage and three replicas, and size the Flex flavor from measured load, not from the class name.

  • Backup schedule on the target

    MongoDB Flex offers scheduled backups every 6, 8, 12 or 24 hours and a 30-hour point-in-time window. Choose retention before cutover.

  • Who owns the secrets

    New credentials for both services belong in your secrets design, not in a pipeline variable.

  • Rollback

    Keep the Alibaba Cloud instances read-only and untouched until the application has run on STACKIT for the agreed period.

Redis and MongoDB: common questions

Is STACKIT Key Value Store the same as Redis?

STACKIT describes Key Value Store as managed instances of the open-source key-value store Valkey, replacing its earlier Redis offering, and as compatible with existing Redis setups. Test your client library and every module command.

Can the Memcache instance move to Valkey?

The run classifies it like a Redis instance, but Valkey is not a Memcache service. Treat the Memcache cache as a client or design change and decide it yourself.

How do I move a MongoDB replica set to MongoDB Flex?

Take a logical backup from ApsaraDB for MongoDB, or run mongodump, and restore with mongorestore into the Flex instance. The STACKIT backup page we read does not describe importing external dumps, so rehearse the load and verify counts and indexes.

Does StackToIT write the STACKIT Terraform for these services?

Not for an Alibaba Cloud source. It writes the assessment, the plan files and a draft skeleton, and lists each database for your architects.

Sources

Your next move: STACKIT.

Tell us about your estate. We show you what StackToIT delivers for it: target architecture, Terraform artifacts and a structured migration plan.