Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full-site Export / Import Format #1563

Open
adamziel opened this issue Jul 1, 2024 · 1 comment
Open

Full-site Export / Import Format #1563

adamziel opened this issue Jul 1, 2024 · 1 comment

Comments

@adamziel
Copy link
Collaborator

adamziel commented Jul 1, 2024

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")
@adamziel
Copy link
Collaborator Author

adamziel commented Jul 1, 2024

@adamziel adamziel changed the title Export / Import Format Full-site Export / Import Format Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant