Home php教程 php手册 【随笔】wordpress 整站搬家

【随笔】wordpress 整站搬家

Jun 06, 2016 pm 08:10 PM
wordpress one year move place run

本站已经运行一年了,由于域名备案,所以一开始本站也就放在国内了。 在国内买了个空间,因为wordpress的搭建很方便,所以付了费,本站很快也就可以使用了。购买的空间 因为是windows 2003+iis6.0的环境,所以wordpress的支持上并不是很好,比如伪静态、总是

本站已经运行一年了,由于域名备案,所以一开始本站也就放在国内了。

在国内买了个空间,因为wordpress的搭建很方便,所以付了费,本站很快也就可以使用了。购买的空间因为是windows 2003+iis6.0的环境,所以wordpress的支持上并不是很好,比如伪静态、总是设置的不尽人意。还有运行速度,网站经常无法访问,前半年还能忍,因为不怎么写文章,只是开发过程中遇到的问题写出来。

而下半年开始断断续续的写文章了,发现空间简直无法忍受。所以在空间租用快结束的时候,便有了更换空间的念头。在网上搜索了一下,也上了taobao。本以为找一个国内空间挺简单的,毕竟域名已经备案了。但了解了两天之后,发现合适的真少。

主要涉及到域名接入的问题。更换空间,也要更换域名备案接入商,更换接入商,需要知道域名备案的密码。密码忘记了,手机换了,而且邮箱填的是以前的企业邮箱。所以找回密码是不可能的了,密码找不回来,接入商就不能改变,我又不想使用原先的空间,所以也就考虑了香港的空间,又花了点时间了解了下香港空间的费用,最后决定选择香港vps,也就是现在本站使用的vps。


购买了vps后,开始备份wordpress,程序好备份,直接ftp拖下来就可以。然后是数据库,因为我以前用的是虚拟空间,在后台使用“备份数据库”功能时,备份的数据库文件在还原中总是出现问题。所以我联系了客服,直接说是要mysql的数据库文件。过了一段时间,客服打包好了,并放到了虚拟空间中。因为我现在用的是linux主机,所以windows 的文件在linux下无法使用。

所以,我在本地搭建了php+apache+mysql,在本地备份文件成功。然后通过linux的管理后台中的phpmyadmin将数据库恢复成功。

数据库恢复成功后,ftp上传原先的wordpress文件。上传成功后,修改以下地方:

1.wp-config.php文件,修改数据库连接信息

/** 数据库名 */
define('DB_NAME', '数据库名');
/** MySQL 数据库用户名 */
define('DB_USER', '数据库用户名');
/** MySQL 数据库密码 */
define('DB_PASSWORD', '数据库密码');
/** MySQL 主机 */
define('DB_HOST', 'localhost');

如果没有更换域名,修改完wp-config.php,网站就可以成功访问了。

2.如果更换了域名,需要修改数据库中wp_options 表。将表中字段siteurl和home修改为当前域名。

原创文章,转载请注明: 转载自沉默的小丑

本文链接地址: 【随笔】wordpress 整站搬家

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Recommended product registration plug-in for easy-to-use wordpress Recommended product registration plug-in for easy-to-use wordpress Apr 20, 2025 am 08:15 AM

There is no perfect WordPress product registration plugin, the choice should be based on actual needs and website size. Recommended plug-ins include: MemberPress: powerful but high-priced, complex configuration Restrict Content Pro: Focus on content restrictions and member management, cost-effective Easy Digital Downloads: Sell digital products, and users register as additional functions

WordPress website is online but cannot be searched WordPress website is online but cannot be searched Apr 20, 2025 am 09:00 AM

Reasons why WordPress websites cannot be found in search engines: 1. Indexing issues; 2. Content issues; 3. Website technical issues; 4. Link issues; 5. Other issues such as geographical restrictions, website name and social media presence.

How to change the head image of the wordpress theme How to change the head image of the wordpress theme Apr 20, 2025 am 10:00 AM

A step-by-step guide to replacing a header image of WordPress: Log in to the WordPress dashboard and navigate to Appearance >Theme. Select the topic you want to edit and click Customize. Open the Theme Options panel and look for the Site Header or Header Image options. Click the Select Image button and upload a new head image. Crop the image and click Save and Crop. Click the Save and Publish button to update the changes.

How to adjust the wordpress article list How to adjust the wordpress article list Apr 20, 2025 am 10:48 AM

There are four ways to adjust the WordPress article list: use theme options, use plugins (such as Post Types Order, WP Post List, Boxy Stuff), use code (add settings in the functions.php file), or modify the WordPress database directly.

How to close comments with wordpress How to close comments with wordpress Apr 20, 2025 am 11:54 AM

How to turn off a comment in WordPress? Specific article or page: Uncheck Allow comments under Discussion in the editor. Whole website: Uncheck "Allow comments" in "Settings" -> "Discussion". Using plug-ins: Install plug-ins such as Disable Comments to disable comments. Edit the topic file: Remove the comment form by editing the comments.php file. Custom code: Use the add_filter() function to disable comments.

What to do if there is an error in wordpress What to do if there is an error in wordpress Apr 20, 2025 am 11:57 AM

WordPress Error Resolution Guide: 500 Internal Server Error: Disable the plug-in or check the server error log. 404 Page not found: Check permalink and make sure the page link is correct. White Screen of Death: Increase the server PHP memory limit. Database connection error: Check the database server status and WordPress configuration. Other tips: enable debug mode, check error logs, and seek support. Prevent errors: regularly update WordPress, install only necessary plugins, regularly back up your website, and optimize website performance.

How to copy wordpress code How to copy wordpress code Apr 20, 2025 pm 12:00 PM

How to copy WordPress code? Copy from the admin interface: Log in to the WordPress website, navigate to the destination, select the code and press Ctrl C (Windows)/Command C (Mac) to copy the code. Copy from a file: Connect to the server using SSH or FTP, navigate to the theme or plug-in file, select the code and press Ctrl C (Windows)/Command C (Mac) to copy the code.

How to display wordpress comments How to display wordpress comments Apr 20, 2025 pm 12:06 PM

Enable comments in WordPress website: 1. Log in to the admin panel, go to "Settings" - "Discussions", and check "Allow comments"; 2. Select a location to display comments; 3. Customize comments; 4. Manage comments, approve, reject or delete; 5. Use <?php comments_template(); ?> tags to display comments; 6. Enable nested comments; 7. Adjust comment shape; 8. Use plugins and verification codes to prevent spam comments; 9. Encourage users to use Gravatar avatar; 10. Create comments to refer to

See all articles