Kembali ke Studi Kasus

    Nextcloud Migration Between Kubernetes Clusters

    Last updated on April 9, 2025

    Morphius HA Cluster Topology

    Project Overview

    This project involved migrating Nextcloud, a self-hosted cloud storage and collaboration platform, from an existing Kubernetes cluster to a new cluster while ensuring data integrity, minimal downtime, and seamless functionality post-migration. The migration covered all critical components, including application configurations, persistent storage, and the database.

    The process required precise backups and restores to maintain Nextcloud’s user data, settings, and metadata. Additionally, because Nextcloud relies on persistent storage (NFS and local PVs) and a database (PostgreSQL), careful planning was essential to ensure a successful migration.

    The Challenge

    The migration posed several key challenges: Persistent Storage Migration: Ensuring the Nextcloud data stored on Persistent Volumes (PVs) and Persistent Volume Claims (PVCs) was properly transferred without corruption or loss.

    • Database Migration: Exporting and restoring the Nextcloud database while maintaining consistency between the old and new environments.

    • Secrets & ConfigMaps: Recreating secrets (such as database credentials) and configuration maps in the new cluster to match the original setup.

    • Minimal Downtime: Ensuring business continuity by minimizing downtime during the migration process.

    • Networking Adjustments: Ensuring Ingress controllers settings were properly mapped to the new cluster.

    Project Objectives

    The primary goals of this migration were:

    • Backup and restore Nextcloud application configurations (Deployments, Helm charts configuration, Services, Secrets, ConfigMaps, PVCs).

    • Migrate persistent data from NFS storage and local persistent volumes without data corruption.

    • Backup and restore the Nextcloud database with all user files and metadata intact.

    • Minimize service downtime during the transition.

    • Reconfigure Nextcloud settings in the new environment to ensure smooth functionality.

    Result

    The migration was successfully completed with minimal downtime of approximately 40 minutes that is why we did it at 2 AM local time, ensuring zero data loss and a fully functional Nextcloud environment on the new Kubernetes cluster.

    The manual database backup and restore process ensured all user data, files, and configurations remained intact.

    By following this structured approach, the Nextcloud instance was successfully migrated, maintaining all user settings, files, and configurations without disrupting service availability for end users.

    Download PDF