# HA mongodb CE statefulset to percona mongodb with operator

**URL:** <https://forums.percona.com/t/ha-mongodb-ce-statefulset-to-percona-mongodb-with-operator/26037>\
**Category:** Percona Operator for MongoDB\
**Tags:** percona, mongodb, psmdb-operator\
**Created:** [October 19, 2023, 11:51am UTC](https://forums.percona.com/t/ha-mongodb-ce-statefulset-to-percona-mongodb-with-operator/26037 "2023-10-19T11:51:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![V4x0u](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/v4x0u/32/17820_2.png) [@V4x0u](https://forums.percona.com/u/V4x0u)\
**Post date:** [October 19, 2023, 11:51am UTC](https://forums.percona.com/t/ha-mongodb-ce-statefulset-to-percona-mongodb-with-operator/26037/1 "2023-10-19T11:51:38Z")

</div>

## Description:

Hi, I’ve been tasked to come up with a plan to migrate several mongodb CE replicasets (4.4) to new ones managed by the Percona Mongodb Operator in a HA manner.

The old stack does not have anything of authorization or authentication enabled as far as i can tell. I already spun up a test setup with the Percona Operator and noticed that the authorization is keyfile based and that there are basic users and roles present.

What i already tried:  
I’ve enabled --transitionToAuth on the old replicaset and added the same keyfile + users and roles to the old cluster. I tried to add the new operator managed containers as members of the old replicaset but they do not seem to be reachable, even though they’re in the same namespace and I’m 100% I’m using the right fqdns + port for them.

## Version:

Mongodb 4.4 (old replicaset)  
percona/percona-server-mongodb:4.4.24-23 (new replicaset)  
psmdb-operator 1.14.2

## Expected Result:

A way to get the new replicaset in sync with the old one and do a brief service interruption (RO mode) and switch the service to the new replicaset. Another approach would be making the new replicaset members of the old one and switch in a HA manner.

I’ve been going through most of the documentation and i can’t seem to find a migration path that fits what is asked of me. Any help, guidance or critique is super welcome!

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [October 19, 2023, 1:36pm UTC](https://forums.percona.com/t/ha-mongodb-ce-statefulset-to-percona-mongodb-with-operator/26037/2 "2023-10-19T13:36:18Z")

</div>

Hey @V4x0u ,

[cross-site replication](https://docs.percona.com/percona-operator-for-mongodb/replication.html) and external replica-set nodes allow to do exactly what you need.

You can read more here as well:

> **[Migrating MongoDB to Kubernetes](https://www.percona.com/blog/migrating-mongodb-to-kubernetes)**
>
> Migrating MongoDB to Kubernetes is a challenging task, but it is much simpler with Percona Distribution for MongoDB Operator.

> **[Disaster Recovery for MongoDB on Kubernetes](https://www.percona.com/blog/disaster-recovery-for-mongodb-on-kubernetes)**
>
> How to set up MongoDB on two distant Kubernetes clusters with Percona Distribution for MongoDB Operator to meet the toughest DR requirements.

Hope this helps. Please feel free to reach out if something is still not working.
