Difference between revisions of "WordPress"

From rbachwiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
* Copy the entire folder over from the old installation to the new server
* Copy the entire folder over from the old installation to the new server
* Check the wp-config.php file make sure everything is ok
* Check the wp-config.php file make sure everything is ok
== If you change the URL then you have to update the database also==
* Log into phpmyadmin
* click sql
* make sure you change the table to the proper name
UPDATE bd_options SET option_value = replace(option_value, 'http://www.oldurl.com', 'http://www.newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE bd_posts SET post_content = replace(post_content, 'http://www.oldurl.com', 'http://www.newurl.com');
UPDATE bd_postmeta SET meta_value = replace(meta_value,'http://www.oldurl.com','http://www.newurl.com');
UPDATE bd_usermeta SET meta_value = replace(meta_value, 'http://www.oldurl.com', 'http://www.newurl.com');
UPDATE bd_links SET link_url = replace(link_url, 'http://www.oldurl.com','http://www.newurl.com');
UPDATE bd_comments SET comment_content = replace(comment_content , 'http://www.oldurl.com','http://www.newurl.com');
===If you have images linked in your posts then you need to run the following additional queries.===
''''For images inside posts'''
UPDATE wp_posts SET post_content = replace(post_content, 'Existing URL', 'New URL');
'''For images linked in old link manager'''
UPDATE wp_links SET link_image = replace(link_image, 'Existing URL','New URL');
'''For images linked as attachments'''
UPDATE wp_posts SET guid = replace(guid, 'Existing URL','New URL');




==[[Open Source Software]]==
==[[Open Source Software]]==

Latest revision as of 16:39, 10 May 2022

Move Wordpress to a new server

  • Export the database.
  • Create a blank database in phpmyadmin with the same name
  • Import the database into the database you just created
  • Copy the entire folder over from the old installation to the new server
  • Check the wp-config.php file make sure everything is ok

If you change the URL then you have to update the database also

  • Log into phpmyadmin
  • click sql
  • make sure you change the table to the proper name
UPDATE bd_options SET option_value = replace(option_value, 'http://www.oldurl.com', 'http://www.newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE bd_posts SET post_content = replace(post_content, 'http://www.oldurl.com', 'http://www.newurl.com');
UPDATE bd_postmeta SET meta_value = replace(meta_value,'http://www.oldurl.com','http://www.newurl.com');
UPDATE bd_usermeta SET meta_value = replace(meta_value, 'http://www.oldurl.com', 'http://www.newurl.com');
UPDATE bd_links SET link_url = replace(link_url, 'http://www.oldurl.com','http://www.newurl.com');
UPDATE bd_comments SET comment_content = replace(comment_content , 'http://www.oldurl.com','http://www.newurl.com');

If you have images linked in your posts then you need to run the following additional queries.

'For images inside posts

UPDATE wp_posts SET post_content = replace(post_content, 'Existing URL', 'New URL');

For images linked in old link manager

UPDATE wp_links SET link_image = replace(link_image, 'Existing URL','New URL');

For images linked as attachments

UPDATE wp_posts SET guid = replace(guid, 'Existing URL','New URL');


Open Source Software