Last active
December 13, 2018 12:31
-
-
Save VincentLoy/c7a3201dfcf63e54391517f233fd29eb to your computer and use it in GitHub Desktop.
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
# Fix bad default values | |
sed -i -e "s/0000-00-00 00:00:00/2018-01-01 00:00:00/g" file.sql | |
sed -i -e "s/OLD_DB_PREFIX/NEW_DB_PREFIX/g" file.sql # if needed | |
# Update mysql configuration because of dirty DB (/etc/mysql/mysql.conf.d/mysql.cnf in Ubuntu server | |
[mysqld] | |
innodb_log_file_size = 512M | |
innodb_strict_mode = 0 | |
# then drop the original DB if needed, and created it once again | |
# Import the dump | |
mysql -h localhost --user wordpress -passwordpass wordpress < backup_2018-12-13-0200_Twog_072d4bdbd043-db.sql | |
# Go to the WP folder | |
# Install WP CLI | |
# Run : | |
wp search-replace 'OLD_DOMAIN_OR_IP' 'NEW_DOMAIN_OR_IP' --skip-columns=guid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment