I have cloned the live site's server to give my client a sandbox they can use for their own security tests, and now I am trying to use /admin/tool/replace/index.php to globally change old url to new url in this new test server. (per http://docs.moodle.org/22/en/Moodle_migration). I get the attached "Service Unavailable" page after about 10sec.
I checked my server logs and it has no mention of any problem.
I switched on Moodle's maximum debugging but it did not add information when I tried the "replace" script again.
I next tried to work-around the use of the replace script: I manually did the old/new swap within the database's contents via pg_dump ... sed ... psql, even swapping in base64 encoded strings to change the many absolute links that exist in blocks (see the note on the migration page). Then I had to rebuild the course cache so i added the rebuildcoursecache patch (/admin/tool/rebuildcoursecache/) and attempted to run it for all 500 courses, only to again encounter the same "Service Unavailable" issue. I tried the patch script using only a few courses and it ran to completion OK. It turns out i can run the rebuildcoursecache script using up to 50 courses at once, more than that and that "Service Unavailable" page appears.
But still those links to the old server remain in the blocks. It seems I cannot change those absolute links in the blocks without using that "replace" script, yet for me the script doesn't want to play.
I am out of ideas. Any suggestions?