You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple request to update the documentation to add kubernetes-specific examples for backing up data, and restoring data.
I have example scripts which I created for the purposes of backing up and restoring my own instance.
Backup Script / Commands
#!/bin/bash# Namespace which contains part-db
NAMESPACE="part-db"# The container's name (Not POD!) This... shouldn't change.
CONTAINER_NAME="part-db"# The name of the pod. This, will change depending on your release.
POD_NAME="parts-db-part-db-0"# Path inside of the container where the backup will be created
CONTAINER_BACKUP_PATH="/tmp/partsdb_backup.zip"# Where we want to store the resulting backup. (Relative to current directory)
BACKUP_DESTINATION="mybackup.zip"
kubectl exec -it -n $NAMESPACE -c $CONTAINER_NAME$POD_NAME -- php bin/console partdb:backup --full $CONTAINER_BACKUP_PATH
kubectl cp -n $NAMESPACE -c $CONTAINER_NAME$POD_NAME:$CONTAINER_BACKUP_PATH$BACKUP_DESTINATION
Restore Script / Commands
#!/bin/bash# Backup file relative to current directory. (partsdb.zip exists in my current directory)
BACKUP_FILE="partsdb.zip"# Namespace which contains part-db
NAMESPACE="part-db"# The container's name (Not POD!) This... shouldn't change.
CONTAINER_NAME="part-db"# The name of the pod. This, will change depending on your release.
POD_NAME="parts-db-part-db-0"# Shouldn't need to touch these.
CONTAINER_BACKUP_FOLDER="/var"
CONTAINER_BACKUP_FILE=$BACKUP_FILE
CONTAINER_BACKUP_EXTRACTED="/var/extracted_backups"# Copy backup .zip into container
kubectl cp -n $NAMESPACE -c $CONTAINER_NAME$BACKUP_FILE$POD_NAME:$CONTAINER_BACKUP_FOLDER/$CONTAINER_BACKUP_FILE# Extract backup files to $CONTAINER_BACKUP_EXTRACTED
kubectl exec -it -n $NAMESPACE -c $CONTAINER_NAME$POD_NAME -- unzip $CONTAINER_BACKUP_FOLDER/$CONTAINER_BACKUP_FILE -d $CONTAINER_BACKUP_EXTRACTED# Restore Public/Media
kubectl exec -it -n $NAMESPACE -c $CONTAINER_NAME$POD_NAME -- cp -R $CONTAINER_BACKUP_EXTRACTED/public/media /var/www/html/public
# Overwrite database file.
kubectl exec -it -n $NAMESPACE -c $CONTAINER_NAME$POD_NAME -- cp $CONTAINER_BACKUP_EXTRACTED/var/app.db /var/www/html/var/db
# Delete POD. (Aka, Restart Part-DB)
kubectl delete pod -n $NAMESPACE$POD_NAME
The text was updated successfully, but these errors were encountered:
A simple request to update the documentation to add kubernetes-specific examples for backing up data, and restoring data.
I have example scripts which I created for the purposes of backing up and restoring my own instance.
Backup Script / Commands
Restore Script / Commands
The text was updated successfully, but these errors were encountered: