上有两个网站WordPress
。一个旧的,您需要从中获取所有媒体文件(图像/文档)并将其传输到一个新的,其中您已经拥有自己的帖子和媒体文件。我的行动。
- 我从旧网站获取了整个类别
uploads
并将其上传到新网站。 - 我从表中导出了所有值
wp_posts
,post_type=attachment
然后用我自己的值替换了这些值并将它们导入到新站点自己的数据库中。
INSERT IGNORE INTO `wp_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES
(768, 1, '2019-10-07 14:13:58', '2019-10-07 14:13:58', '', 'Refugee Integration & Economic Contributions', '', 'inherit', 'closed', 'closed', '', 'refugee-integration-economic-contributions', '', '', '2019-10-07 14:13:58', '2019-10-07 14:13:58', '', 767, 'https://rcusa.websitetesturl2.com/wp-content/uploads/2019/10/Refugee-Integration-Economic-Contributions.pdf', 0, 'attachment', 'application/pdf', 0),
(770, 1, '2019-10-07 14:18:29', '2019-10-07 14:18:29', '', 'At A Glance - Refugee Integration and Economic Contributions', '', 'inherit', 'closed', 'closed', '', 'at-a-glance-refugee-integration-and-economic-contributions', '', '', '2019-10-07 14:18:29', '2019-10-07 14:18:29', '', 769, 'https://rcusa.websitetesturl2.com/wp-content/uploads/2019/10/At-A-Glance-Refugee-Integration-and-Economic-Contributions.pdf', 0, 'attachment', 'application/pdf', 0);
它正常导入,需要更改所需表中的ID...但在新站点中我仍然看不到它们,Media Library
为什么?我做错了什么,为什么它们没有显示在库中并且无法选择或分配给其他帖子?
所需要的只是导入。
如果只有媒体文件,那么标准的就足够了。
或者第二种选择是手动上传到服务器并使用插件在媒体库中注册。例如媒体同步
如果它链接到现有记录,那么它是导入插件。
通过你的行为,你很可能破坏了数据库。