Copy pages



Does anyone have a recommendation for copying existing pages from one
parent to

I’m doing it against the database directly (sql, export, import), but
I’m hoping
for a more efficient way.




Do you want to copy them or just move them? Moving them is fairly
trivial with script/console.



Hi Sean,

I need to copy em

BTW- is down?


Quoting Sean C. removed_email_address@domain.invalid:


On Feb 26, 2007, at 2:08 PM, Todd McGrath wrote:

BTW- is down?

yes, it’s not just you.



Yes, I asked John about it, and TextDrive is having issues with the
server. (

There’s not a trivial way to do a deep-copy of a page, but I’ll outline
the process for you.

  1. Open script/console production (assuming you’re running in production
    mode-- I hope)
  2. Use Page.find to get the original page that you intend to copy.
  3. Clone the original page (original.clone).
  4. Assign the parent or parent_id of the cloned page.
  5. Iterate through all the page parts of the original page, clone them,
    and add them as parts to the cloned page.
  6. Save everything.



Todd McGrath wrote:

BTW- is down?

It’s back up now.

John L.