Create the database dump:
ssh -i pemfile.pem user@ip-address "wp db export /home/user/mysql.sql"
# or in Docker a container that has a persistent volume:
ssh -i pemfile.pem user@ip-address "docker exec <container_name> wp db export /home/user/mysql.sql"
Code language: Bash (bash)
Download that file into current folder:
scp -i pemfile.pem user@ip-address:/home/user/mysql.sql ./
Code language: JavaScript (javascript)
Leave a Reply