Skip to content

Instantly share code, notes, and snippets.

@hoangdh
Last active November 26, 2024 03:44
Show Gist options
  • Select an option

  • Save hoangdh/2fd1860c17b1dd75cbcdd2edc5961d4d to your computer and use it in GitHub Desktop.

Select an option

Save hoangdh/2fd1860c17b1dd75cbcdd2edc5961d4d to your computer and use it in GitHub Desktop.

Revisions

  1. hoangdh revised this gist Feb 19, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions migrate-mongodb.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    ## Migrate data MongoDB to another cluster

    Source cluster: 10.10.10.10
    Destination cluster: 10.10.20.10
    - Source cluster: 10.10.10.10
    - Destination cluster: 10.10.20.10

    ```
    mongodump --host 10.10.10.10 --port 27017 --archive --numParallelCollections=10 | \
  2. hoangdh revised this gist Feb 19, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion migrate-mongodb.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ mongodump --host 10.10.10.10 --port 27017 --archive --numParallelCollections=10
    mongorestore --host 10.10.20.10 --port 27017 --archive --numParallelCollections=10 --drop
    ```

    **Note:** Use `--gzip` to save bandwith.
    **Note:** Use `--gzip` to save bandwidth.

    ```
    mongodump --host 10.10.10.10 --port 27017 --archive --gzip --numParallelCollections=10 | \
  3. hoangdh revised this gist Feb 19, 2024. 2 changed files with 16 additions and 6 deletions.
    16 changes: 16 additions & 0 deletions migrate-mongodb.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    ## Migrate data MongoDB to another cluster

    Source cluster: 10.10.10.10
    Destination cluster: 10.10.20.10

    ```
    mongodump --host 10.10.10.10 --port 27017 --archive --numParallelCollections=10 | \
    mongorestore --host 10.10.20.10 --port 27017 --archive --numParallelCollections=10 --drop
    ```

    **Note:** Use `--gzip` to save bandwith.

    ```
    mongodump --host 10.10.10.10 --port 27017 --archive --gzip --numParallelCollections=10 | \
    mongorestore --host 10.10.20.10 --port 27017 --archive --gzip --numParallelCollections=10 --drop
    ```
    6 changes: 0 additions & 6 deletions mongodb_streaming_backup.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +0,0 @@
    ## Streaming backup MongoDB to another cluster

    ```
    mongodump --host 10.10.10.10 --port 27017 --archive --gzip --numParallelCollections=10 | \
    mongorestore --host 10.10.20.10 --port 27017 --archive --gzip --numParallelCollections=10 --drop
    ```
  4. hoangdh created this gist Feb 19, 2024.
    6 changes: 6 additions & 0 deletions mongodb_streaming_backup.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    ## Streaming backup MongoDB to another cluster

    ```
    mongodump --host 10.10.10.10 --port 27017 --archive --gzip --numParallelCollections=10 | \
    mongorestore --host 10.10.20.10 --port 27017 --archive --gzip --numParallelCollections=10 --drop
    ```