Skip to content

Commit

Permalink
docs: created migration folder and added the relevant migration contents
Browse files Browse the repository at this point in the history
Signed-off-by: Bala Harish <[email protected]>
  • Loading branch information
balaharish7 committed Apr 1, 2024
1 parent 5c2db8b commit 15b232f
Show file tree
Hide file tree
Showing 12 changed files with 254 additions and 1,318 deletions.
6 changes: 3 additions & 3 deletions docs/i18n/en/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,15 @@
},
"theme.docs.versions.unreleasedVersionLabel": {
"message": "This is the documentation for the development version of OpenEBS.",
"description": "The label used to tell the user that they are browsing an unreleased doc version"
"description": "The label used to tell the user that he's browsing an unreleased doc version"
},
"theme.docs.versions.unmaintainedVersionLabel": {
"message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.",
"description": "The label used to tell the user that they are browsing an unmaintained doc version"
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionSuggestionLabel": {
"message": "See the documentation for {latestVersionLink} ({versionLabel}).",
"description": "The label userd to tell the user that they are browsing an unmaintained doc version"
"description": "The label userd to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionLinkLabel": {
"message": "latest released version",
Expand Down
8 changes: 8 additions & 0 deletions docs/i18n/en/docusaurus-plugin-content-docs/current.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,13 @@
"sidebar.docs.category.Support": {
"message": "Support",
"description": "The label for category Support in sidebar docs"
},
"sidebar.docs.category.Migration": {
"message": "Migration",
"description": "The label for category Migration in sidebar docs"
},
"sidebar.docs.category.Legacy Storage to New Storage": {
"message": "Legacy Storage to New Storage",
"description": "The label for category Legacy Storage to New Storage in sidebar docs"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ keywords:
- Migration from OpenEBS cStor to OpenEBS Replicated
- cStor to Replicated
- cStor to Mayastor
- Jiva to Replicated
- Jiva to Mayastor
description: This section outlines the process of migrating OpenEBS cStor to OpenEBS Replicated.
---

Expand All @@ -15,7 +17,7 @@ You can also migrate OpenEBS Jiva to OpenEBS Replicated using the steps below.

## Assumptions

- It is an assumption that cStor is already deployed.
- cStor is already deployed.
- MongoDB Standalone is deployed as below using the cStor PVC. (Here, MongoDB Standalone is an example.)

```
Expand All @@ -31,6 +33,7 @@ spec:
requests:
storage: 5Gi
```

- For validation, some data has been inserted in the MongoDB as an example below:

```
Expand All @@ -41,6 +44,7 @@ db.admin.insertMany([{name: "Max"}, {name:"Alex"}])
{ _id: ObjectId('65eaafa01cd2b6de45285d87'), name: 'Alex' }
]
```
## Steps to migrate cStor to Replicated

Follow the steps below to migrate OpenEBS cStor to OpenEBS Replicated (fka Mayastor).

Expand All @@ -64,12 +68,14 @@ spec:

3. Scale down the MongoDB pod.

4. Start the migration and let it complete. See the example below:
4. Start the migration and let it complete.

:::note
Make sure you use the correct cStor pvc name that your application has.
:::info
Use the correct cStor PVC name that your application has.
:::

See the example below:

```
pv-migrate migrate \
--source-namespace default \
Expand All @@ -79,14 +85,15 @@ pv-migrate migrate \
πŸš€ Starting migration
πŸ’­ Will attempt 3 strategies: mnt2, svc, lbsvc
🚁 Attempting strategy: mnt2
πŸ“‚ Copying data... 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| (2.8 GB/s)
πŸ“‚ Copying data... 0% | | [0s:0s]🧹 Cleaning up
πŸ“‚ Copying data... 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ|
πŸ“‚ Copying data... 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| (2.8 GB/s)
πŸ“‚ Copying data... 0% | | [0s:0s]🧹 Cleaning up
πŸ“‚ Copying data... 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ|
✨ Cleanup done
βœ… Migration succeeded
```

5. Deploy the MongoDB application using the Repliated PVC.
5. Deploy the MongoDB application using the Replicated PVC.

6. Once the MongoDB pod is created, check the data.

```
Expand All @@ -113,6 +120,4 @@ test> db.admin.find().pretty()

The migration is successful.

:::note
The cStor volume and pools can now be removed and cStor can be uninstalled.
:::
The cStor volume and pools can now be removed and cStor can be uninstalled.
Original file line number Diff line number Diff line change
@@ -1,9 +1,144 @@
---
id: device-to-lvm
title: Migration from OpenEBS cStor to OpenEBS Replicated
title: Migration from OpenEBS Local PV Device to OpenEBS Local PV LVM
keywords:
- Migration from OpenEBS cStor to OpenEBS Replicated
- cStor to Replicated
-cStor to Mayastor
description: This section outlines the process of migrating OpenEBS cStor to OpenEBS Replicated.
---
- Migration from OpenEBS Local PV Device to OpenEBS LVM Local PV
- Local PV Device to Local PV LVM
- Local PV Device to Local PV ZFS
- Local PV Rawfile to Local PV LVM
- Local PV Rawfile to Local PV ZFS
description: This section outlines the process of migrating OpenEBS Local PV Device to OpenEBS LVM Local PV.
---

:::info
The following steps are an example about migrating from legacy storage to new storage.
You can also migrate OpenEBS Local PV Device to OpenEBS Local PV ZFS & OpenEBS Local PV Rawfile to OpenEBS Local PV LVM or Local PV ZFS using the steps below.
:::

## Assumptions

- Local PV Device is already deployed.
- MongoDB Standalone is deployed as below using the Local PV Device PVC. (Here, MongoDB Standalone is an example.)

```
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: localpv-vol
spec:
storageClassName: openebs-device
accessModes: ["ReadWriteOnce"]
volumeMode: Filesystem
resources:
requests:
storage: 5Gi
```

- For validation, some data has been inserted in the MongoDB as an example below:

```
db.admin.insertMany([{name: "Max"}, {name:"Alex"}])
[
{ _id: ObjectId('65eaafa01cd2b6de45285d86'), name: 'Max' },
{ _id: ObjectId('65eaafa01cd2b6de45285d87'), name: 'Alex' }
]
```
## Steps to migrate Local PV Device to Local PV LVM

Follow the steps below to migrate OpenEBS Local PV Device to OpenEBS Local PV LVM.

1. [Install Local Engine](../../../quickstart-guide/installation.md) on your cluster.

2. Create a LVM PVC of the same [configuration](../../../user-guides/local-engine-user-guide/lvm-localpv.md#configuration).

:::info
For the LVM volume to be created, the node (where the application was deployed) needs to be same as that of where Volume Group (VG) is created.
:::

See the example below:

```
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-lvmpv
allowVolumeExpansion: true
parameters:
storage: "lvm"
volgroup: "lvmvg"
provisioner: local.csi.openebs.io
allowedTopologies:
- matchLabelExpressions:
- key: kubernetes.io/hostname
values:
- node-1-152720
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: csi-lvmpv
spec:
storageClassName: openebs-lvmpv
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
```

3. Scale down the MongoDB pod.

4. Start the migration and let it complete.

:::info
Use the correct Local PV Device PVC name that your application has.
:::

See the example below:

```
pv-migrate migrate \
--source-namespace default \
--dest-namespace default \
localpv-vol csi-lvmpv
πŸš€ Starting migration
πŸ’­ Will attempt 3 strategies: mnt2, svc, lbsvc
🚁 Attempting strategy: mnt2
πŸ“‚ Copying data... 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| (3.4 GB/s)
πŸ“‚ Copying data... 0% | | [0s:0s]🧹 Cleaning up
πŸ“‚ Copying data... 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ|
✨ Cleanup done
βœ… Migration succeeded
```

5. Deploy the MongoDB application using the LVM PVC.

6. Once the MongoDB pod is created, check the data.

```
root@mongo-lvm-556f58cd7d-rws6l:/# mongosh -u admin -p admin123
Current Mongosh Log ID: 65eabe0ee915a8cf7d9eee57
Connecting to: mongodb://<credentials>@127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.1.5
Using MongoDB: 7.0.6
Using Mongosh: 2.1.5
For mongosh info see: https://docs.mongodb.com/mongodb-shell/
------
The server generated these startup warnings when booting
2024-03-08T07:27:19.404+00:00: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem
2024-03-08T07:27:19.747+00:00: vm.max_map_count is too low
------
test> db.admin.find().pretty()
[
{ _id: ObjectId('65eab75b8f5d183790d7bbd5'), name: 'Max' },
{ _id: ObjectId('65eab75b8f5d183790d7bbd6'), name: 'Alex' }
]
```

The migration is successful.

The Local PV Device volumes and pools can now be removed and Local PV Device can be uninstalled.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
description: This section outlines the process of migrating the legacy storage to new storage.
---

# Overview
# Migration Overview

In this migration process, we are using [pv-migrate](https://github.com/utkuozdemir/pv-migrate) that is a CLI tool/kubectl plugin to easily migrate the contents of one Kubernetes `PersistentVolumeClaim` to another.

Expand Down
Loading

0 comments on commit 15b232f

Please sign in to comment.