summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbt <bt@web>2024-05-23 09:43:24 -0500
committerIkiWiki <ikiwiki.info>2024-05-23 09:43:24 -0500
commit56b456df6dae9dc76939a30392df9f5db4639246 (patch)
tree1577a78aa87cf2407eef71108ddefc4c28ceb088
parent0e701f7c4c3c8a601426eb865c8849e0bfe7f2af (diff)
-rw-r--r--wordpress/database_update.mdwn19
1 files changed, 19 insertions, 0 deletions
diff --git a/wordpress/database_update.mdwn b/wordpress/database_update.mdwn
new file mode 100644
index 0000000..202e2cf
--- /dev/null
+++ b/wordpress/database_update.mdwn
@@ -0,0 +1,19 @@
+The following page contains a collection of scripts to update WordPress for numerous things.
+
+## Updating the URL of the Database
+
+ -- Replace in wp_options table
+ UPDATE wp_options SET option_value = REPLACE(option_value, 'example.com', 'example2.com') WHERE option_name = 'home' OR option_name = 'siteurl';
+
+ -- Replace in wp_posts table
+ UPDATE wp_posts SET post_content = REPLACE(post_content, 'example.com', 'example2.com');
+ UPDATE wp_posts SET guid = REPLACE(guid, 'example.com', 'example2.com');
+
+ -- Replace in wp_postmeta table
+ UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'example.com', 'example2.com');
+
+ -- Replace in wp_usermeta table
+ UPDATE wp_usermeta SET meta_value = REPLACE(meta_value, 'example.com', 'example2.com');
+
+ -- Replace in wp_users table
+ UPDATE wp_users SET user_url = REPLACE(user_url, 'example.com', 'example2.com');