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
SET @old_url='old.domain'; | |
SET @new_url='new.domain'; | |
UPDATE wp_options SET option_value = replace(option_value, @old_url, @new_url) WHERE option_name = 'home' OR option_name = 'siteurl' | |
UPDATE wp_posts SET guid = replace(guid, @old_url, @new_url) | |
UPDATE wp_posts SET post_content = replace(post_content, @old_url, @new_url) | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, @old_url, @new_url) |
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
<?php | |
include 'wp-config.php'; | |
$servername = DB_HOST; | |
$username = DB_USER; | |
$password = DB_PASSWORD; | |
$dbname = DB_NAME; | |
$old_url = ""; | |
$new_url = ""; |
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
<?php | |
include 'wp-config.php'; | |
$DBUSER = DB_USER; | |
$DBPASSWD = DB_PASSWORD; | |
$DATABASE = DB_NAME; | |
$filename = "backup-" . date("d-m-Y") . ".sql.gz"; | |
$mime = "application/x-gzip"; |
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
SET @user_login='john_doe'; | |
SET @user_pass=MD5('YOUR_HARD_PASSWORD'); | |
SET @user_nicename=@user_login; | |
SET @user_email='john.doe@example.com'; | |
SET @user_url='http://example.com/'; | |
SET @display_name='John Doe'; | |
INSERT INTO `wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES (null, @user_login, @user_pass, @user_nicename, @user_email, @user_url, CURRENT_TIMESTAMP(), '', '0', @display_name); | |
SET @last_id=LAST_INSERT_ID(); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, @last_id, 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); |