WordPress/wordpress-playground

Full-site Export / Import Format

Opened this issue · 1 comments

Let's standardize the site export format used by Playground to:

  • Provide users with a reliable, useful export that will continue to work in the future
  • Explore a format we'll eventually propose for WordPress core
  • Unlock integrating Playground with webhosts

With #1398, no platform-level files live in the WordPress site directory – this makes Playground so much more portable.

Technical implementation

I propose the following format:

  • The export is a ZIP file
  • In the archive root, there’s wp-adminwp-contentwp-includes, other WordPress files
    • wp-config.php is shipped and contains all the data it did contain in Playground
  • No "storage optimization" is done
    • All the WordPress static assets are included in the export, even if Playground was booted from a minified build.
    • All the exported .php files are unminified, even if Playground was booted from a minified build.
    • The default WordPress theme is present in wp-content/themes.
  • In wp-content, two non-standard artifacts are shipped:
    • A series of .sql files containing the full database dump (to stream-write, e.g. up to 500KB in each)
    • The SQLite database dump to enable fast loading in Playground (importing .sql can take noticeable time)
  • No other non-standard artifacts are present in the ZIP. In particular:
    • The SQLite integration plugin is not shipped
    • Drop-in plugins like db.php are not shipped
    • Playground mu-plugins are not shipped

This would enable:

  • Booting Playground directly from the zip file (both in CLI and in the browser)
  • Importing both into Playground and with regular PHP
  • Importing both into MySQL and SQLite
  • Streamed download

Related work

Let's reuse as much of the work already done as possible:

Outside of scope

  • Rewriting links and assets URLs. This will need to land soon after the format, but is not strictly required for the format itself. The URLs would be stream-rewritten on export from the stored site URL to https://wordpress.internal URL using the rewriting flow we'll need for markdown importing. The importer would stream-rewrite them before inserting each post into the database.
  • Support for non-standard wp-content path
  • Support for exporting env variables or server-provided constants
  • Partial export ("I want just these three plugins")