准备
新服务器或者虚拟空间
原来服务器(可以登录进去)
mysql数据库
PC电脑
步骤
1、从原服务器/虚拟空间中复制出来wordpress程序,放到新的虚拟空间上面,是下面这些文件
![](https://img.laitimes.com/img/9ZDMuAjOiMmIsIjOiQnIsIyZuBnLiZDMwkzM3YjYyUmM1ITYiV2YwQjM4MWMkVDMwQ2Y4E2Lc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
2、修改数据库信息,打开根目录的wp-config.php,DB_NAME是你的数据库名称,DB_USER是你的数据库用户名,DB_PASSWORD是你的数据库密码。
3、然后通过虚拟空间上自带的phpadmin或者用自己的navicat连接数据库,导出.sql
4、然后修改数据库
UPDATE wp_options SET option_value = '你的网址带上http或https' where option_value = '旧网址';
UPDATE wp_posts SET post_content = '你的网址带上http或https' where post_content = '旧网址';
UPDATE wp_comments SET comment_content = '你的网址带上http或https' where comment_content = '旧网址';
UPDATE wp_comments SET comment_author_url = '你的网址带上http或https' where comment_author_url = '旧网址';
5、完成。