I just successfully copied a book but it required me to set the memory above 120M and the execution time above 120 seconds.

This is too long so I would suggest taking some approaches to alleviate this.

Suggestions for reducing memory usage:

  • Don't keep a node in memory unless you need it, if you need to record which nodes were processed then record their IDs or something.

Suggestions for alleviating the time it takes to run:

  • Run it in a background task like what you get when uploading a file. Advantage of this is you would also be able to add a progress indicator.
  • Split copy operations into batches and try not to exceed 20 seconds per batch.
  • Do everything in one transaction (will reduce database stress.)

Comments

jgraham’s picture

I think of these solutions batch is the most appropriate.

jgraham’s picture

Status: Active » Closed (duplicate)

I have opened a new issue to implement the batch API for the copy operation.
http://drupal.org/node/888504