INSERT INTO site_content (pagetitle, menutitle, description, introtext, content, longtitle ) SELECT value0, value1, value2, value3, value4, value5 FROM huge_table WHERE id BETWEEN 1 AND 100000
<?php
include 'config.core.php';
include MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->exec("UPDATE {$modx->getTableName('modResource')} SET uri = '' WHERE uri_override = 0");
$modx->call('modResource', 'refreshURIs', array(&$modx));
This question has been answered by multiple community members. See the first response.
set_time_limit(3600); // 1hr
ini_set('max_execution_time', 1000000000);
<?php... to execute the script only for the IDs between 1000 and 2000 so something like ( WHERE id BETWEEN 1000 AND 2000 )?
include 'config.core.php';
include MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->call('modResource', 'refreshURIs', array(&$modx));
UPDATE `site_content` SET `uri` = '/test-parent/' id '.html' WHERE id BETWEEN 1000 AND 100000
UPDATE `site_content` SET `uri` = '/test-parent/' '.html' WHERE id BETWEEN 1000 AND 100000
UPDATE `site_content` SET `uri` = id WHERE id BETWEEN 1000 AND 100000
UPDATE `site_content` SET `uri` = '.html' WHERE parent = 1001
UPDATE `site_content` SET `uri` = CONCAT('test-parent/',id, uri) WHERE parent = 1001