Documentation Demo import & migration

02 / Sample content

Demo import & migration

Choose the workflow for a clean sample site or an existing Purlia installation.

For Purlia 1.0.14 min readUpdated 4 Nov 2026

Choose one workflow

WorkflowUse whenWhat it changes
Start without demo dataYou want your own catalog and content.Create pages with Purlia patterns and choose your own Media images.
Fresh demo importYou have a clean staging installation.Imports sample pages, posts, products, variations and Media.
Existing demo migrationYou already use an older Purlia demo with theme-file image URLs.Reuses marked Media, adds missing originals and converts legacy Purlia image blocks.

What the sample data contains

The optional export contains 16 pages, 6 journal posts, 14 products, 46 variations and 18 Media attachments. Yarn specifications, prices, inventory, contact details and policies are illustrative. The three pattern previews contain sample project notes, not professionally tested PDF patterns.

The export excludes customer accounts, orders, comments/reviews, API keys, subscribers and payment setup. Imported contact/newsletter form IDs are placeholders; create and select your own forms. Media originals are supplied in demo-content/media/.

Import a fresh demo with WP-CLI

This path uses the bundled image originals, so it does not depend on the public demo hosting those uploads. A developer or host can run these commands. Replace the example paths with the locations on your server.

  1. Install and activate Purlia and WooCommerce on a clean staging site. Complete WooCommerce’s page creation.
  2. Install and activate the official WordPress Importer. Place the entire demo-content folder on the server; keep all helper files and its Media subfolder together.
  3. From the WordPress installation directory, prepare the product attributes:
shell
wp eval-file "/absolute/path/to/demo-content/prepare-attributes.php"

Then import the sample data from local files:

shell
wp eval-file "/absolute/path/to/demo-content/import-local-demo.php"

The helper calls the official importer, repairs native image attachment IDs for the target site and rebuilds WooCommerce’s product lookup tables. Keep the command output and resolve any reported error before continuing.

Using the WordPress import screen

  1. Create the global attributes listed in demo-content/attributes.json: Color, Fiber and Yarn weight. See Catalog and products.
  2. Open Tools → Import → WordPress and select purlia-demo.xml. Assign content to your existing staging author.
  3. Enable downloading/importing attachments. This GUI path requires the source demo to contain all exported Media URLs. If images are unavailable, use the offline CLI path instead.
  4. After importing, have your developer run the finalizer below to repair image IDs and product lookup data:
shell
wp eval-file "/absolute/path/to/demo-content/finalize-demo.php"

Migrate an existing Purlia demo

  1. Back up the database and files, then test the complete update on staging.
  2. Upload/activate Purlia 1.0.1 and place the supplied demo-content folder on the server.
  3. Run the existing-site helper:
shell
wp eval-file "/absolute/path/to/demo-content/migrate-existing-site.php"

The helper reuses marked demo attachments, imports only missing originals and replaces old Purlia theme-file image blocks. It retains merchant-selected Media and product images. It logs a temporary JSON backup location for changed page content; WordPress revisions also remain available where supported. A second run should not create duplicate marked images.

Complete either demo setup

  1. Assign Home and Blog under Settings → Reading. Assign WooCommerce pages under WooCommerce → Settings → Advanced.
  2. Save permalinks and inspect product/variation prices, stock and images.
  3. Update Navigation links to your own page and category URLs. Review links in page content after a domain migration.
  4. Set Color term swatches. Select your own optional contact and newsletter forms.
  5. Replace demo policy copy and contact details. Configure actual shipping, tax and sandbox payment.
  6. Compare Home 1–4, Shop, a variable product, Cart and Checkout on desktop/mobile before publishing.
Your store guide