sql 使用MySQL将大型Neos NodeTree移动到新的Parent

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 使用MySQL将大型Neos NodeTree移动到新的Parent相关的知识,希望对你有一定的参考价值。

START TRANSACTION;
SET NAMES utf8 COLLATE utf8_unicode_ci;
alter database YOUR_DATABASE default character set utf8;
alter database YOUR_DATABASE default collate utf8_unicode_ci;

SET @whereLikePath = '%node-57fe3793425c0%';
SET @oldPath = '/sites/theme/node-57fe3793425c0';
SET @newPath = '/sites/theme/node-nm3vs6pu3hzod/node-57fe3793425c0';
SET @oldParentpath = '/sites/theme';
SET @newParentpath = '/sites/theme/node-nm3vs6pu3hzod';

UPDATE YOUR_DATABASE.neos_contentrepository_domain_model_nodedata n SET n.`path` = REPLACE(n.`path`, @oldPath, @newPath), n.parentpath = REPLACE(n.parentpath, @oldParentpath, @newParentpath), n.pathhash = MD5(n.`path`), n.parentpathhash = MD5(n.parentpath) WHERE n.`path` like @whereLikePath;
COMMIT;
START TRANSACTION;
SET NAMES utf8 COLLATE utf8_unicode_ci;
alter database YOUR_DATABASE default character set utf8;
alter database YOUR_DATABASE default collate utf8_unicode_ci;

SET @whereLikePath = '%node-q8ddaajoua2j3%';
SET @oldName = 'node-q8ddaajoua2j3';
SET @newName = 'node-5c1t64seyao71';

UPDATE YOUR_DATABASE.neos_contentrepository_domain_model_nodedata n SET n.`path` = REPLACE(n.`path`, @oldName, @newName), n.parentpath = REPLACE(n.parentpath, @oldName, @newName), n.pathhash = MD5(n.`path`), n.parentpathhash = MD5(n.parentpath) WHERE n.`path` like @whereLikePath;
COMMIT;

以上是关于sql 使用MySQL将大型Neos NodeTree移动到新的Parent的主要内容,如果未能解决你的问题,请参考以下文章

如何将数据库从数百 MB 的大型 SQL 文件导入 MySQL

如何在Neos CMS中创建新项目?

新用户角色typo3 neos

sh 从命令行打开Neos项目

sh Uberspace 7 Neos安装

sh Neos包装neu laden