如何导出整个 Wordpress 网站?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18984596/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:21:49  来源:igfitidea点击:

How do I export an entire Wordpress website?

wordpressplugins

提问by Michaela LeBlanc

I was wondering how to export an entire wordpress website. This includes all pages, the theme, any tweaks to the theme, everything... So that when I import it to another URL, it looks exactly the same in every way possible.

我想知道如何导出整个 wordpress 网站。这包括所有页面、主题、对主题的任何调整、一切……所以当我将它导入另一个 URL 时,它在所有可能的方面看起来都完全相同。

回答by Mustafa Ekici

You can actually use the WordPress Duplicator plugin, check the link below:

您实际上可以使用 WordPress Duplicator 插件,请查看以下链接:

http://wordpress.org/plugins/duplicator/

http://wordpress.org/plugins/duplicator/

This plugin scans your site and creates a backup of the WordPress site then creates an installer.php file. Download those files and put them on the new server. Run the installer.php and follow the docsto be up and running in no time.

此插件会扫描您的站点并创建 WordPress 站点的备份,然后创建一个 installer.php 文件。下载这些文件并将它们放在新服务器上。运行 installer.php 并按照文档立即启动并运行。

回答by jeanpier_re

There are a number of ways to migrate a Wordpress site.

有多种方法可以迁移 Wordpress 站点。

Plugin route (easiest)With plugins I'd suggest duplicator if you want something pretty standard (like a single site with a pretty standard configuration...no multi-site or BuddyPress). And if you're willing to spring a little cash BackupBuddy works well too but falls short for more complex setups.

插件路线(最简单)如果你想要一些非常标准的东西(比如一个具有非常标准配置的单个站点......没有多站点或 BuddyPress),我会建议使用插件复制器。如果您愿意花一点钱,BackupBuddy 也可以很好地工作,但不能用于更复杂的设置。

Manual routeAssuming your site's url will stay the same you could just do a MySQL dump and move your PhP files from the root of your Wordpress setup. This tends to be buggy as Wordpress wasn't really designed to move in this way but with a bit of fiddling around you'll get the site back up.

手动路由假设您网站的 url 保持不变,您只需执行 MySQL 转储并从 Wordpress 设置的根目录移动您的 PhP 文件。这往往是有问题的,因为 Wordpress 并不是真正设计为以这种方式移动,但稍微摆弄一下,您就可以恢复站点。

I'd only choose this route if you're really comfortable with MySQL management and have at least a bit of a background programming PhP or else it could get frustrating.

如果您真的对 MySQL 管理感到满意并且至少有一点后台编程 PhP,我只会选择这条路线,否则它可能会令人沮丧。

Rebuild OptionYou could just reverse engineer your site. So imagine your server went down but you had backups of your entire site: exports, themes, plugins etc. You could just re-install Wordpress then use the Wordpress importer plugin to get your data, then tweak it all to make it pretty. A useful resource for this approach is Wordpress Codex article on Migrations.

重建选项您可以对您的网站进行逆向工程。因此,想象一下您的服务器出现故障,但您有整个站点的备份:导出、主题、插件等。您可以重新安装 Wordpress,然后使用 Wordpress 导入器插件获取您的数据,然后对其进行调整以使其更美观。这种方法的一个有用资源是 关于迁移的 Wordpress Codex 文章。

Rsync routeThis one I haven't done myself yet but if you're extremely comfortable with your server environment and have root access you could use a tool like rsync to literally clone the server. From what I understand this is similar to how disc images work but I honestly can't tell you much more than that. I'd recommend checking out Rsync Documentationfor more on that.

Rsync route这个我自己还没有做过,但是如果你对你的服务器环境非常满意并且有 root 访问权限,你可以使用像 rsync 这样的工具来克隆服务器。据我所知,这类似于光盘映像的工作方式,但老实说,我不能告诉你更多。我建议查看Rsync 文档以了解更多信息。

回答by palisir

Usually, to backup a Wordpress installation you just have to copy the /wp-content directory, and the database. The wp-content directory contains the plugins, files uploaded on the site, or whatever that is specific to your site. So later if you would like to use wp-content and the database on a new WP installation, you may have to update some modules or functions used in themes.

通常,要备份 Wordpress 安装,您只需复制 /wp-content 目录和数据库。wp-content 目录包含插件、上传到站点的文件或特定于您站点的任何内容。所以稍后如果您想在新的 WP 安装上使用 wp-content 和数据库,您可能需要更新主题中使用的一些模块或功能。

That said, it sometimes happens that other files in wp-admin or wp-includes are modified. It's really not a good practice but if you don't know what has been done on the WP, you better have to backup all the directories.

也就是说,有时会发生 wp-admin 或 wp-includes 中的其他文件被修改的情况。这确实不是一个好习惯,但如果您不知道在 WP 上做了什么,则最好备份所有目录。

回答by ChaseC

You do as Patrick said. You have to copy your wordpress directory. If you are using a database, copy the sql dump. Once you place the directory and sql dump where you want it, you may need to change some of the code because your files will have a new location.

你按照帕特里克说的去做。你必须复制你的 wordpress 目录。如果您使用的是数据库,请复制 sql 转储。一旦您将目录和 sql dump 放在您想要的位置,您可能需要更改一些代码,因为您的文件将有一个新位置。

Just point the code in the right direction.

只需将代码指向正确的方向。

There is the easy way if you know how to use plug-ins. You can find many of them that will copy your Wordpress site for you to a location that you want.

如果您知道如何使用插件,那么有一个简单的方法。您可以找到其中许多将您的 Wordpress 站点复制到您想要的位置。