将Wordpress网站移动到其他域/服务器的问题 [英] Problems with moving my Wordpress site to another domain/server
问题描述
我在将wordpress网站从一个网域移动到另一个网域时遇到问题。我搜索了网站,但找不到一个有用的答案,我的情况。
这是我做的:
我做了网站的备份。然后我导出数据库。
然后我安装Wordpress在其他域。
然后我复制了所有的Wordpress文件的旧网站在新服务器上覆盖新的安装。然后我从新服务器上的数据库删除了一切,并导入旧服务器的数据库。然后我改变了数据库的名称和bpassword在wp配置文件。
所以我做了这一切,但新的网站不工作,我不知道哪里出错了?
谢谢你的帮助!
它需要做的是将数据库中的2个字段更新为正确的域。
方法1:
将此行添加到您的wp-config。 php文件,然后访问 http://yournewdomain.com/wp-admin.php ,并登录这将强制更新:
define('RELOCATE',true);
登录后,您应该删除该行。
方法2:
将这两行添加到您的主题的functions.php文件,位于wp-content / themes / themename / functions.php
update_option('siteurl','http://example.com/blog');
update_option('home','http://example.com/blog');
之后,您需要更新每个帖子的GUID。在phpMyAdmin中或从mysql命令行问题:
UPDATE wp_posts SET guid = REPLACE(
guid,
'http://exampleoldsiteurl.com',
'http://examplenewsiteurl.com');
将exampleoldsite和examplenewsite替换为相应的域。
所有这些信息都可以在 http://codex.wordpress.org/Changing_The_Site_URL
I'm having problems moving a wordpress site from one domain to another. I've searched the site but couldn find a useful answer for my situation.
Here's what i did:
I made a backup of the website. Then i exported the database. Then i installed Wordpress on the other domain. Then i copied all my Wordpress files of the old website on the new server overwriting the new installation. Then i deleted everything from the database on the new server and imported the database of the old server. Then i changed the database name and bpassword in the wp-config file.
So i did all this but the new site isn't working, and i don't know where it went wrong? So i'd like to start over, but what should i do different?
Thankyou for your help!
The main thing you need to do is update 2 fields in the database to the correct domain.
It can be done a few different ways.
Method 1:
Add this line to your wp-config.php file, then visit http://yournewdomain.com/wp-admin.php and log in. This will force the update:
define('RELOCATE',true);
After you log in, you should remove that line.
Method 2:
Add these 2 lines to your theme's functions.php file found at wp-content/themes/themename/functions.php
update_option('siteurl','http://example.com/blog');
update_option('home','http://example.com/blog');
After that, you need to update the GUID for each post. In phpMyAdmin or from the mysql command line issue this:
UPDATE wp_posts SET guid = REPLACE (
guid,
'http://exampleoldsiteurl.com',
'http://examplenewsiteurl.com');
replace exampleoldsite and examplenewsite with the respective domains.
All of this info can be found at http://codex.wordpress.org/Changing_The_Site_URL
这篇关于将Wordpress网站移动到其他域/服务器的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!