Download live WordPress Database over SSH/SCP

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)

Posted

in

, , , , , ,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.