|
| 1 | +================================= |
| 2 | +Back Up and Restore Security Keys |
| 3 | +================================= |
| 4 | + |
| 5 | +.. default-domain:: mongodb |
| 6 | + |
| 7 | +.. contents:: On this page |
| 8 | + :local: |
| 9 | + :backlinks: none |
| 10 | + :depth: 1 |
| 11 | + :class: singlecol |
| 12 | + |
| 13 | +.. include:: /includes/backup-restore-intro.rst |
| 14 | + |
| 15 | +To prevent this from occurring, you should back up the encryption keys |
| 16 | +after the initial deployment and store them in a safe location. For a |
| 17 | +production Charts deployment you should also back up the data in the |
| 18 | +Charts metadata database using :manual:`MongoDB backup methods |
| 19 | +</core/backups>`. |
| 20 | + |
| 21 | +Back Up Keys |
| 22 | +------------ |
| 23 | + |
| 24 | +.. include:: /includes/backup-keys.rst |
| 25 | + |
| 26 | +Restore Keys |
| 27 | +------------ |
| 28 | + |
| 29 | +.. tabs:: |
| 30 | + |
| 31 | + tabs: |
| 32 | + |
| 33 | + - id: windows |
| 34 | + name: Windows PowerShell |
| 35 | + content: | |
| 36 | + |
| 37 | + To restore the keys on the host of the new Charts deployment, first |
| 38 | + copy the keys from the external location to the target host. For |
| 39 | + example, ``C:\temp\charts-keys-backup``. Then run the following commands |
| 40 | + before deploying |charts-short| from the docker-compose file: |
| 41 | + |
| 42 | + .. code-block:: sh |
| 43 | + |
| 44 | + docker volume create mongodb-charts_keys |
| 45 | + docker run -it ` |
| 46 | + --volume mongodb-charts_keys:/volume ` |
| 47 | + --volume /c/temp/charts-keys-backup:/backup ` |
| 48 | + alpine sh -c 'cp /backup/* /volume' |
| 49 | + |
| 50 | + .. include:: /includes/fact-docker-unix-paths-windows.rst |
| 51 | + |
| 52 | + - id: macos |
| 53 | + name: macOS |
| 54 | + content: | |
| 55 | + |
| 56 | + To restore the keys on the host of the new Charts deployment, first |
| 57 | + copy the keys from the external location to the target host. For |
| 58 | + example, ``/tmp/charts-keys-backup``. Then run the following commands |
| 59 | + before deploying |charts-short| from the docker-compose file: |
| 60 | + |
| 61 | + .. code-block:: sh |
| 62 | + |
| 63 | + docker volume create mongodb-charts_keys |
| 64 | + docker run -it \ |
| 65 | + --volume mongodb-charts_keys:/volume \ |
| 66 | + --volume /tmp/charts-keys-backup:/backup \ |
| 67 | + alpine sh -c 'cp /backup/* /volume' |
| 68 | + |
| 69 | + - id: linux |
| 70 | + name: Linux |
| 71 | + content: | |
| 72 | + |
| 73 | + To restore the keys on the host of the new Charts deployment, first |
| 74 | + copy the keys from the external location to the target host. For |
| 75 | + example, ``/tmp/charts-keys-backup``. Then run the following commands |
| 76 | + before deploying |charts-short| from the docker-compose file: |
| 77 | + |
| 78 | + .. code-block:: sh |
| 79 | + |
| 80 | + docker volume create mongodb-charts_keys |
| 81 | + docker run -it \ |
| 82 | + --volume mongodb-charts_keys:/volume \ |
| 83 | + --volume /tmp/charts-keys-backup:/backup \ |
| 84 | + alpine sh -c 'cp /backup/* /volume' |
0 commit comments