https://github.com/nzbr/kine-migrate
Migrate data from one kine backend (K3s database) to another
https://github.com/nzbr/kine-migrate
k3s kubernetes
Last synced: 3 months ago
JSON representation
Migrate data from one kine backend (K3s database) to another
- Host: GitHub
- URL: https://github.com/nzbr/kine-migrate
- Owner: nzbr
- License: apache-2.0
- Created: 2024-11-19T06:39:00.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-11-19T06:42:50.000Z (11 months ago)
- Last Synced: 2025-06-07T12:44:28.158Z (5 months ago)
- Topics: k3s, kubernetes
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kine-migrate
Migrate [kine](https://github.com/k3s-io/kine) (the [K3s](https://k3s.io) database) data from one supported backend / database to another
## Building
```bash
go build .
```
This should result in a binary called `kine-migrate`
## Usage
```bash
kine-migrate --from --to
```
For supported connection strings, see [the k3s docs](https://docs.k3s.io/datastore#datastore-endpoint-format-and-functionality) or the documentation of the library kine uses for the connection for those not mentioned there (notably sqlite).
If using sqlite, make sure to enable WAL mode by appending `?_journal=wal` to the connection string. For the default sqlite database, this would look like this:
```
sqlite:///var/lib/rancher/k3s/server/db/kine.db?_journal=wal
```
## Disclaimer
I do not currently have any plans to propoerly maintain this tool.
It is here in the hope that it might be useful to someone else.
You may still open an issue if something doesn't work, but I can't guarantee that I will fix it.
I needed this exactly once to migrate my kine db from sqlite to mysql, which worked great, but it is also the only thing that has been tested.
Back up your data before using this tool.
Double-check if you have --from and --to set in the correct direction.
I am not responsible if you somehow manage to delete your database with this.