https://rancher.com/ logo
Title
m

mammoth-battery-28500

05/20/2023, 8:58 PM
I've been using k3s for a month or so now. When I originally set it up, I set up 3 masters using HA embedded etcd. I'd now like to migrate to an external postgres DB. I can't seem to find any information on migrating from etcd to postgres. Does anyone have any instructions on how to do that, or could point me in a direction?
c

creamy-pencil-82913

05/21/2023, 12:08 AM
That's not a supported migration, so there's not a super easy way to do that.
You'd probably be best off starting over with a new cluster and redeploying your applications
m

mammoth-battery-28500

05/21/2023, 1:18 AM
OK, well, at least now I know. Makes me think twice about making the move. I might still do it because I have all the manifests / charts, but it's not just a migration.
Thanks!
a

alert-policeman-61846

05/23/2023, 7:29 AM
@creamy-pencil-82913 any idea of the complexity of a scripted migration. I guess the db format must be straightforward KV, which might be generated from etcd dump ?
c

creamy-pencil-82913

05/23/2023, 8:28 AM
You could stand up a temporary standalone kine instance backed by your target DB, use an etcd client to dump the keys out of the current cluster and into kine, and then point k3s at the DB.
👍 1
You can't use an etcd snapshot, it would have to be a dump/load
a

alert-policeman-61846

05/23/2023, 10:42 AM
Nice. I guess it would me more complex if origin kine is not etcd (eg: moving from a mysql backend to a postgres backend) ?
c

creamy-pencil-82913

05/23/2023, 4:06 PM
Nah should work the same. You should be able to use an etcd client to do most things against kine.
👍 1
a

alert-policeman-61846

05/24/2023, 3:03 PM
tkhs @creamy-pencil-82913