Extract and insert pages in a transaction