2020-11-09 14:44:46 +00:00
|
|
|
# Backing up a database.
|
2020-11-09 01:43:21 +00:00
|
|
|
|
|
|
|
Admin mongodb username is: `root`
|
|
|
|
|
|
|
|
Run these on source cluster:
|
|
|
|
|
|
|
|
Syntax:
|
|
|
|
|
|
|
|
`sudo kubectl exec <pod> -- mongodump --uri="mongodb://<mongousername>:<mongopassword>@localhost:27017/<databasename>" --archive="<export-filepath>"`
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
2022-01-28 22:34:06 +00:00
|
|
|
`sudo kubectl exec fi-mongodb-0 -- mongodump --uri="mongodb://oneuptime:password@localhost:27017/oneuptimedb" --archive="/bitnami/mongodb/oneuptimedata.archive"`
|
2020-11-09 01:43:21 +00:00
|
|
|
|
|
|
|
**Step 2**: Copy file from conatiner to local machine.
|
|
|
|
|
|
|
|
Syntax:
|
|
|
|
|
|
|
|
`sudo kubectl cp <pod>:<filepath> <localfilePath>`
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
2021-11-24 07:42:40 +00:00
|
|
|
`sudo kubectl cp fi-mongodb-0:/bitnami/mongodb/oneuptimedata.archive /Volumes/DataDrive/Projects/OneUptime/app/backup.archive`
|