简体   繁体   English

WordPress 从 Windows 迁移到 Linux,无法登录到暂存站点

[英]WordPress Migration from Windows to Linux, Unable to Login to Staging Sites

I am working to migrate a clients WP site from Windows to Linux, and I am having an issue logging into their DEV and PROD site after successfully migrating UAT to the new servers.我正在努力将客户端 WP 站点从 Windows 迁移到 Linux,并且在成功将 UAT 迁移到新服务器后登录到他们的 DEV 和 PROD 站点时遇到问题。

A little background to uncomplicate this, they have three sites (DEV/UAT/and PROD) on a Windows server that are currently still viewable to the public.有一点背景可以简化这一点,他们在 Windows 服务器上拥有三个站点(DEV/UAT/和 PROD),这些站点目前仍可供公众查看。

The new Linux servers, since the migrations have not yet been completed, are only accessible by the IP address.由于尚未完成迁移,新的 Linux 服务器只能通过 IP 地址访问。 As of now, I have been able to successfully migrate the UAT site from the old servers to the new servers, using WP All in One Migration.到目前为止,我已经能够使用 WP All in One Migration 成功地将 UAT 站点从旧服务器迁移到新服务器。 I am able to log into the UAT instance, make changes, updates, etc. However, when I try to log into the DEV and PROD instances on the new servers, I am getting an error that the WP username/email does not exist, so I am unable to complete the migration for the remaining two instances.我可以登录 UAT 实例,进行更改、更新等。但是,当我尝试登录新服务器上的 DEV 和 PROD 实例时,我收到一个错误,即 WP 用户名/电子邮件不存在,所以我无法完成其余两个实例的迁移。 I am still able to log into the old Windows servers and make changes, but not the new servers.我仍然可以登录旧的 Windows 服务器并进行更改,但不能登录新服务器。

Any help would be greatly appreciated!任何帮助将不胜感激!

You likely did not get a usable full copy of the database.您可能没有获得可用的数据库完整副本。 When you migrate WordPress around, the files on the server is only a small portion of the data you need.当您迁移 WordPress 时,服务器上的文件只是您需要的数据的一小部分。 You MUST get copies of everything in the database as well or the site will not function.您还必须获取数据库中所有内容的副本,否则该站点将不会 function。 Do a dump of the database and then restore it on your DEV/UAT database node.转储数据库,然后在您的 DEV/UAT 数据库节点上恢复它。 You may need to jump through some hoops to change the URL that is embedded in the database as well for the sites to function properly as well, It's a PITA, but once you get the hang of it.您可能需要跳过一些障碍才能将嵌入数据库中的 URL 以及站点也正确更改为 function,这是一个 PITA,但一旦你掌握了它。 you can script it and take the human out of the loop.您可以编写脚本并将人类排除在循环之外。 I used to do this with a script that ran the DB search and replace statements.我曾经使用运行数据库搜索和替换语句的脚本来执行此操作。

As an alternative, you can add a user (even an administrator) to WordPress using only the database.作为替代方案,您可以仅使用数据库将用户(甚至是管理员)添加到 WordPress。 Can be handy in some situations...在某些情况下可以派上用场...

INSERT INTO databasename .插入databasename名称。 wp_users ( ID , user_login , user_pass , user_nicename , user_email , user_status , d isplay_name ) VALUES ('1000', 'usernamefornewuser', MD5('plaintextnewuserpassword'), 'usernameforyournewuser', 'newuseremail@somenewuseremaildomain.com', '0', 'The New User I just created'); wp_users ( ID , user_login , user_pass , user_nicename , user_email , user_status , d isplay_name ) VALUES ('1000', 'usernamefornewuser', MD5('plaintextnewuserpassword'), 'usernameforyournewuser', 'newuseremail@somenewuseremaildomain.com', '0', '我刚刚创建的新用户');

INSERT INTO databasename .插入databasename名称。 wp_usermeta ( umeta_id , user_id , meta_key , meta_value ) VALUES (NULL, '1000', 'wp_ca pabilities', 'a:1:{s:13:"administrator";b:1;}'); wp_usermeta ( umeta_id , user_id , meta_key , meta_value ) VALUES (NULL, '1000', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');

INSERT INTO databasename .插入databasename名称。 wp_usermeta ( umeta_id , user_id , meta_key , meta_value ) VALUES (NULL, '1000', 'wp_us er_level', '10'); wp_usermeta ( umeta_id , user_id , meta_key , meta_value ) VALUES (NULL, '1000', 'wp_user_level', '10');

There are some values you will have to change however I have personally used these MySQL snippets with WordPress for many, many moons (years.).您必须更改一些值,但是我个人将这些 MySQL 片段与 WordPress 一起使用了很多很多个月(年)。

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

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