기술 자료

​
​

Development

User Acquisition

Monetization

산업 분야

Self-Hosted Deployment

Amazon Web Services

Microsoft Azure

On premises

vpctl

Self-Hosted Deployment

이 페이지는 선택한 언어로 제공되지 않습니다.
​
​
Self-Hosted Deployment
  • Overview
  • Amazon Web Services
    • Release notes
    • Installation
      • Infrastructure overview
      • Prerequisites
      • Deployment
      • Postdeployment
        • Set up the identity subsystem
        • Set up backups for Percona Server for MongoDB
        • Set up Percona Monitoring and Management
        • Migrate data to Percona Server for MongoDB
      • Security
      • Costs
    • Maintenance
  • Microsoft Azure
  • On premises
  • Administration
  • Security
  • vpctl
  1. Self-Hosted Deployment (previously called Unity Virtual Private Cloud)
  2. Self-Hosted Deployment in Amazon Web Services
  3. Installation

Migrate your data to Percona Server for MongoDB

If you use Percona Server for MongoDB, migrate your data to it from the MongoDB virtual machine in your Kubernetes cluster
읽는 시간 3분
최근 업데이트: 한 달 전

Migrate your data from the MongoDB virtual machine (VM) to Percona Server for MongoDB (PSMDB) in your Kubernetes cluster at your own pace with a staged approach.
The Terraform variable
enable_percona_mongo
is for the deployment of the PSMDB operator and database in your Kubernetes cluster as a parallel setup. This variable is disabled by default. However, to ensure zero downtime, all services initially continue using your current MongoDB instance. The connection string logic follows this priority order:
  1. The custom URI, if provided
  2. The existing MongoDB VM
  3. The new PSMDB cluster
To migrate your data to PSMDB, follow these steps:
  1. Connect to your MongoDB instance through SSH, for example, using AWS Systems Manager Agent (SSM Agent).
  2. To assign the
    backup
    role to the user who is to run the backup script, run this command:
    # Connect to MongoDB and grant the backup rolemongo --username {admin_username} --password {admin_password} --authenticationDatabase admindb.grantRolesToUser("asset-manager", ['backup'])
    Use these values:
    • admin_username
      : the
      asset-manager
      user if you're using our MongoDB VM
    • admin_password
      : the password that is stored in the
      mongo_db_connection_string
      secret in Secret Manager
  3. Copy the backup script from the following location, and then run it:
    ./aws/scripts/mongodb-backup.sh
    To provide the correct username and password, run this command:
    ./mongodb-backup.sh asset-manager {password}
  4. Retrieve the .tar file, for example, using the Secure Copy Protocol (SCP).
  5. To validate which pod is the primary pod, run these commands:
    kubectl exec -it psmdb-db-rs0-x -c mongod -- bashmongo --username {admin_username} --password {admin_password} --authenticationDatabase adminrs.status()
    The password is stored in the
    psmdb_asset_manager_password
    secret in Secret Manager.
    중요
    You must run the restore operation on the primary pod, otherwise the operation fails. Ensure you perform the next steps on the primary pod.
    The primary pod is the pod that has these values:
    • "state" : 1
    • "stateStr" : "PRIMARY"
  6. To retrieve .the tar file using SCP and copy it to the PSMDB primary pod, run this command:
    kubectl cp ~/tmp/mongo_data_backup_YYYY-MM-DD_HH-MM-SS.tar.gz psmdb-db-rs0-x:/tmp/mongo_backup_YYYY-MM-DD_HH-MM-SS.tar.gz -c mongod
  7. Copy the restore script from the following location to the primary pod:
    ./aws/scripts/mongodb-restore.sh
    Run this command:
    kubectl cp ~/scripts/mongodb-restore.sh psmdb-db-rs0-x:/tmp/mongodb-restore.sh -c mongod
  8. To connect to the primary pod and import the backup, run these commands:
    kubectl exec -it psmdb-db-rs0-x -c mongod -- bashcd /tmpchmod +x mongodb-restore.sh./mongodb-restore.sh asset-manager {password} mongo_backup_YYYY-MM-DD_HH-MM-SS.archive
  9. To update the
    mongo_connection_uri
    terraform variable to use the new PSMDB cluster, run this command:
    mongo_connection_uri = "mongodb+srv://asset-manager:{password}@psmdb-db-rs0.{kubernetes_namespace}.svc.cluster.local?authSource=admin&replicaSet=rs0&ssl=false"
  10. Restart the Asset Manager services so that they use the new connection string.
  11. When you're sure that the new PSMDB cluster is working, you can disable MongoDB VM instance by setting the Terraform variable
    enable_mongo=false
    .

Copyright © 2026 Unity Technologies
법률 정보개인정보 처리방침쿠키Documentation Terms of Use개인 정보 판매 또는 공유 금지개인정보 보호 선택(쿠키 설정)

'Unity', Unity 로고 및 기타 Unity 상표는 미국 및 기타 지역 내 Unity Technologies 또는 그 계열사의 상표 또는 등록상표입니다(자세한 내용은 여기에서 확인하세요). 기타 명칭 또는 브랜드는 해당 소유자의 상표입니다.

일부 페이지는 편의를 위해 기계 번역되었으며 부정확한 내용이 있을 수 있습니다. 정보가 상충되는 경우, 영어 버전을 우선으로 참조하세요.


    이 페이지의 문제 보고