简体   繁体   English

从本地 wordpress 迁移到服务器的问题

[英]Migration problems from local wordpress to a server

I've recently started using Wordpress for a school project, and since i already had a google cloud account from before, i decided to host my site there.我最近开始在学校项目中使用 Wordpress,因为我之前已经有一个谷歌云帐户,所以我决定在那里托管我的网站。 I created it locally and designed it, to see if it would work, but now i am trying to migrate it to the google cloud server.我在本地创建并设计了它,看看它是否可以工作,但现在我正在尝试将它迁移到谷歌云服务器。 I export my database, then import it into the server.我导出我的数据库,然后将其导入服务器。 Now when i did this at first Wordpress told me i had already installed it (correct), then threw me into a blank page.现在,当我一开始这样做时,Wordpress 告诉我我已经安装了它(正确),然后把我扔进了一个空白页。 After searching around for a bit i found this , right here on Stack Overflow and it made sense to me.在搜索了一下之后,我发现了这个,就在 Stack Overflow 上,这对我来说很有意义。 So i ran the commands, replacing all instances of localhost with serverIP .所以我运行了命令,用serverIP替换了localhost的所有实例。

Now the reason i am asking this question is because the above procedure didn't fix my problem.现在我问这个问题的原因是因为上述程序没有解决我的问题。 It correctly redirects serverIP to serverIP/siteName , but it gives me a 404 error.它正确地将serverIP重定向到serverIP/siteName ,但它给了我一个 404 错误。 I am wondering, if i did something wrong, and how i could fix it?我想知道,如果我做错了什么,我该如何解决?

Thank you for the answers in advance.感谢您提前回答。

Edit: Detail i forgot to add, though i don't think it matters: my local computer (where i originally hosted wp) runs Windows 10, while the google cloud server runs Ubuntu 16.04.编辑:细节我忘了添加,虽然我认为这并不重要:我的本地计算机(我最初托管 wp 的地方)运行 Windows 10,而谷歌云服务器运行 Ubuntu 16.04。

This is not a direct answer to your question, but it may be the solution to your problem.这不是您问题的直接答案,但它可能是您问题的解决方案。 I will describe another way how to get your wordpress page from your localhost development to your webhost.我将描述另一种方法如何将 wordpress 页面从 localhost 开发获取到您的虚拟主机。

  1. Install wordpress on your webhost as it is with the newest version from wordpress.org在您的虚拟主机上安装 wordpress,因为它是来自 wordpress.org 的最新版本

  2. Finish the install progress, so wordpress sets up all database tables for you and all is empty (except the hello world post and the data privacy page).完成安装进度,wordpress 为你设置好所有数据库表,全部为空(hello world post 和数据隐私页面除外)。

  3. Go to your localhost wordpress backend and install under tools the wordpress export plugin to export all your data in your website. Go 到您的本地主机 wordpress 后端并在工具下安装 wordpress 导出插件以导出您网站中的所有数据。 The result is an xml file.结果是一个 xml 文件。 But you can also use a plugin like https://wordpress.org/plugins/all-in-one-wp-migration/但你也可以使用像https://wordpress.org/plugins/all-in-one-wp-migration/这样的插件

  4. Copy your complete wp-content folder from your localhost wordpress page via ftp into your wordpress installation on the webhost.从本地主机 wordpress 页面通过 ftp 将完整的 wp-content 文件夹复制到虚拟主机上的 wordpress 安装中。 you can first delete it and than put the folder from the localhost in.您可以先将其删除,然后将本地主机中的文件夹放入。

  5. Go to your freshly installed wordpress page, activate all your now appearing plugins (if you have some) and under tools in the backend, use the wordpress importer to load all your data in the new database (may take a few minutes). Go 到您新安装的 wordpress 页面,激活您现在出现的所有插件(如果有的话),然后在后端的工具下,使用 wordpress 导入您的新数据库需要几分钟。 You can also use a plugin like all in one wp migration.您还可以在一个 wp 迁移中使用一个插件。

  6. The plugin you postet is to overwrite the urls in your database.您发布的插件是覆盖数据库中的网址。 This is useful, if you change the base url of your wordpress site.如果您更改 wordpress 站点的基础 url,这很有用。 If you followed the steps, you should actually don't have to do it.如果您按照这些步骤操作,则实际上不必这样做。 But you can, if want to be double sure or have some data with the urls in your database.但是你可以,如果你想确定或在你的数据库中有一些带有 url 的数据。

Hope this makes your deploy more easy.希望这使您的部署更容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM