Created
December 6, 2018 16:41
-
-
Save fredeerock/6abfea06b5aa0af771675aebf87cac79 to your computer and use it in GitHub Desktop.
Simple WordPress Backup and Restore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup WordPress DB. Find the servername, username, and db name from wp-config.php. | |
mysqldump --column-statistics=0 -h <sql-server-name> -u <sql-username> -p <sql-db-name> | bzip2 -c > blog.bak.sql.bz2 | |
# Restore WordPress DB. | |
# First, uncompress the sql backup file. | |
bzip2 -d blog.bak.sql.bz2 | |
# Second, import the the database tables. Added protocol for docker compatability. | |
mysql -h localhost -P 8037 --protocol=tcp -u root -p wordpress < blog.bak.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment