简体   繁体   English

WordPress从主机移到本地服务器

[英]Wordpress move from host to local server

I am quite new to WordPress and PHP, so apologies for the questions that may sound a bit primitive. 我对WordPress和PHP相当陌生,因此为听起来有些原始的问题道歉。 I have a site on WordPress but it's really slow and contains a lot of legacy code. 我在WordPress上有一个网站,但它的运行速度确实很慢,并且包含许多旧代码。 What do I want is to create the new theme and make some optimization. 我想要的是创建新主题并进行一些优化。 For this reason, I want to move from Web to local storage and play around in a secure way. 因此,我想从Web转移到本地存储并以安全的方式进行游戏。 What do I have? 我有什么? A have SQL file and a copy of file system taken from the server via FTP. 通过FTP从服务器获取的具有SQL文件和文件系统的副本。 I put the site's copy to local OpenServer and via phpAdmin, with MySQL Workbench I have my site running on the local server. 我使用MySQL Workbench将站点的副本通过phpAdmin放置到本地OpenServer上,使站点在本地服务器上运行。 Of course, I have performed in phpMyAdmin this script: 当然,我已经在phpMyAdmin中执行了以下脚本:

SET SQL_SAFE_UPDATES = 0;
UPDATE aw3ed6gb_options SET option_value = replace(option_value, 'https://fbs-tax.com','http://fbs-local') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE aw3ed6gb_posts SET guid = replace(guid, 'https://fbs-tax.com','http://fbs-local'); 
UPDATE aw3ed6gb_posts SET post_content = replace(post_content, 'https://fbs-tax.com','http://fbs-local');
UPDATE aw3ed6gb_site SET domain='fbs-local' WHERE domain LIKE '%fbs-tax.com%';
UPDATE aw3ed6gb_sitemeta SET meta_value='http://fbs-local' WHERE `meta_value`LIKE '%fbs-tax.com%';
UPDATE aw3ed6gb_blogs SET domain = replace(domain, 'fbs-tax.com','fbs-local');
UPDATE aw3ed6gb_usermeta SET meta_value='fbs-local' WHERE meta_key='source_domain';

Also in my wp-config.php I have this: 同样在我的wp-config.php中,我有这个:

define('WP_CACHE', true);
define( 'ADMIN_COOKIE_PATH', '/mygolad' );
define( 'WPCACHEHOME', __DIR__ . '/wp-content/plugins/wp-super-cache/' ); define('DB_NAME', 'db_local_0');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8mb4');
define('DB_COLLATE', '');
define('SHORTPIXEL_API_KEY', 'eCRnNMw6yaf4ztoDM4F5');

The propblem is that when I try to access http://fbs-local/wp-admin I can not sign in with any user/pswrd. 问题是,当我尝试访问http:// fbs-local / wp-admin时,无法使用任何用户/ pswrd登录。 So my questions are: 所以我的问题是:

  • how access to wp-admin; 如何访问wp-admin;
  • can I start a new WordPress project and then just add to it my DB; 我可以启动一个新的WordPress项目,然后将其添加到数据库中吗?
  • if second yes can I reformat SQL from 5.5 to 5.7; 如果是,可以将SQL的格式从5.5重新格式化为5.7;
  • maybe the problem is in wrong DB copy; 也许问题出在错误的数据库副本中;

Thank you for your help! 谢谢您的帮助!

I often have to migrate wordpress websites and I always use this plugin . 我经常不得不迁移wordpress网站,并且我总是使用此插件

This saves you a lot of work. 这样可以节省很多工作。 It will copy all files (theme, plugins, media files etc.) and the database of your website. 它将复制所有文件(主题,插件,媒体文件等)和您网站的数据库。

You just need to install this plugin on your current website and export all data. 您只需要在当前网站上安装此插件并导出所有数据即可。 After this you have to install the plugin on your local installation (a clean installation is recommended). 之后,您必须在本地安装中安装插件(建议全新安装)。 Now you just have to import the file from the other website. 现在,您只需从其他网站导入文件。

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

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