将wordpress站点从一个localhost转移到另一个localhost

时间:2023-01-15 21:00:38

I'm trying to move wp site from localhost on my work computer to my personal computer. I have followed these steps:

我正在尝试将wp站点从我的工作计算机上的localhost移动到我的个人计算机上。我遵循了以下步骤:

  1. Copy wp-content folder
  2. 复制wp-content文件夹

  3. Export database
  4. Import database
  5. Paste wp-content folder
  6. 粘贴wp-content文件夹

  7. Configure config.php

It had copied all the themes and plugins, but content (images, text, pages etc) doesn't display. Did I skipped something?

它复制了所有主题和插件,但内容(图像,文本,页面等)不会显示。我跳过了什么吗?

2 个解决方案

#1


0  

You shouldn't transfer the wp-content folder as a whole, wordpress won't like it and wont find any of the posts/images within it.

你不应该整体转移wp-content文件夹,wordpress不会喜欢它并且不会在其中找到任何帖子/图像。

If you transfer over just the theme and plugins first so all the files are in place and then do the import of the database you may have more luck.

如果你只是转移主题和插件,所以所有文件都已到位,然后导入数据库,你可能会有更多的运气。

The only problem will be the images, which may go missing due to the fact that they cannot be downloaded via localhost. Sadly the only way i can think of fixing that is through going through each page and re-adding them.

唯一的问题是图像,由于它们无法通过localhost下载而可能会丢失。可悲的是,我能想到修复的唯一方法是通过浏览每个页面并重新添加它们。

#2


0  

If the URL was changed:

如果URL已更改:

http://codex.wordpress.org/Moving_WordPress

I would recommend to check wp_config table in the database for the following entries:

我建议检查数据库中的wp_config表以获取以下条目:

option_name=’siteurl‘ or option_name=’home‘

option_name ='siteurl'或option_name ='home'

and check if the values are correct for the new installation.

并检查新安装的值是否正确。

#1


0  

You shouldn't transfer the wp-content folder as a whole, wordpress won't like it and wont find any of the posts/images within it.

你不应该整体转移wp-content文件夹,wordpress不会喜欢它并且不会在其中找到任何帖子/图像。

If you transfer over just the theme and plugins first so all the files are in place and then do the import of the database you may have more luck.

如果你只是转移主题和插件,所以所有文件都已到位,然后导入数据库,你可能会有更多的运气。

The only problem will be the images, which may go missing due to the fact that they cannot be downloaded via localhost. Sadly the only way i can think of fixing that is through going through each page and re-adding them.

唯一的问题是图像,由于它们无法通过localhost下载而可能会丢失。可悲的是,我能想到修复的唯一方法是通过浏览每个页面并重新添加它们。

#2


0  

If the URL was changed:

如果URL已更改:

http://codex.wordpress.org/Moving_WordPress

I would recommend to check wp_config table in the database for the following entries:

我建议检查数据库中的wp_config表以获取以下条目:

option_name=’siteurl‘ or option_name=’home‘

option_name ='siteurl'或option_name ='home'

and check if the values are correct for the new installation.

并检查新安装的值是否正确。