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

Improve migration docs: import/export WordPress sites with Playground #1166

Open
5 of 7 tasks
flexseth opened this issue Mar 30, 2024 · 11 comments
Open
5 of 7 tasks

Improve migration docs: import/export WordPress sites with Playground #1166

flexseth opened this issue Mar 30, 2024 · 11 comments

Comments

@flexseth
Copy link
Collaborator

flexseth commented Mar 30, 2024

Much of what Playground does is meant to be portable. Whether you want to import an existing website to demo a plugin, change a theme and provide a working demo back to the client... importing and exporting is a big part of what the Playground does.

However, there is virtually no documentation on how to import content or websites with Playground.

Action items

Existing documentation

Import a WXZ or a WXR file

You can import a WordPress export file by uploading a WXZ, or WXR file in /wp-admin/.

You can also use JSON Blueprints. See getting started with Blueprints to learn more.

  • Provide functioning blueprint code sample and import file

This is different from the import feature described above. The import feature exports the entire site, including the database. This import feature imports a WXR or WXZ file into an existing site.

What is WXZ file? No documentation....

  • Create documentation and sample WXZ file if applicable - not applicable - wait for Site Transfer protocol

About WXZ import...
#88 (comment)

@adamziel
Copy link
Collaborator

adamziel commented Apr 2, 2024

Improve docs on importing content via WXR

Fully agreed. The importFileStep should be just called importWXR while keeping the old name working.

Improve docs on importing via WXZ (what is this?)

I'd just remove WXZ support at this point. I'm not sure if anyone uses it or is aware of that format and at the same time it adds a maintenance overhead. If someone reports a WXZ issue, we won't be able fix it. Besides, the Site Transfer Protocol will solve the same problem, but more completely and without problems with IDs and database relations.

Manually importing and exporting sites via CLI & MySQL + files

The WordPress Playground plugin enables that from wp-admin. We don't yet have other export&import workflows in place. @bgrgicak what do you think about adding a "Download Snapshot" button to that plugin so that it could be easily imported into Playground?

The ultimate solution will be the Site Transfer Protocol, but we're not there yet. The Documentation Workflow explores the first baby steps with rewriting Site URLs in the exported files.

@bgrgicak
Copy link
Collaborator

bgrgicak commented Apr 3, 2024

The WordPress Playground plugin enables that from wp-admin. We don't yet have other export&import workflows in place. @bgrgicak what do you think about adding a "Download Snapshot" button to that plugin so that it could be easily imported into Playground?

Sounds good, it shouldn't be a lot of work. Should we also add import support?
Adding a CLI command for both wouldn't be a lot of extra work.

@flexseth flexseth moved this to In Progress in Playground Documentation Apr 3, 2024
@flexseth flexseth moved this from In Progress to Todo in Playground Documentation Apr 3, 2024
@adamziel
Copy link
Collaborator

adamziel commented Apr 3, 2024

Should we also add import support?

I wouldn't do it yet. Sure, there's existing code we could transplant, but without the upcoming bits from Site Transfer Protocol it will break.

Adding a CLI command for both wouldn't be a lot of extra work.

Let's hold on with that and keep the scope minimal for now. It's difficult enough to keep up with maintaining the existing Playground implementations.

@bgrgicak
Copy link
Collaborator

bgrgicak commented Apr 5, 2024

I added Playground snapshot as an option to Tools > Export.

The exported ZIP doesn't work with Playground because the export format is different for the Playground plugin and Playground web. This will need to be addressed separately.

@adamziel Should we adjust the plugin export format to match Playground, or should we add this as another format to Playground?

@bgrgicak
Copy link
Collaborator

bgrgicak commented Apr 5, 2024

@adamziel Should we adjust the plugin export format to match Playground, or should we add this as another format to Playground?

This will need to be implemented in Playground. The Playground export uses wp-content/database/.ht.sqlite and that plugin uses schema/_Schema.sql. These two exports are in different formats.
I suggest that we add some code that detects if schema/_Schema.sql exists in the import zip and execute it as SQL. This would match what the plugin is doing.

@adamziel
Copy link
Collaborator

adamziel commented Apr 5, 2024

Agreed, both places should be the same format and the .sql file might be impossible to avoid if it needs to be portable. I'm just worried about binary data.

@bgrgicak
Copy link
Collaborator

bgrgicak commented Apr 5, 2024

Here is the export PR WordPress/playground-tools#219
It also updates the db path to wp-content/database/database.sql.

@bgrgicak
Copy link
Collaborator

bgrgicak commented Apr 5, 2024

Playground import issue #1201

@flexseth
Copy link
Collaborator Author

flexseth commented Apr 9, 2024

Should we also add import support?

I wouldn't do it yet. Sure, there's existing code we could transplant, but without the upcoming bits from Site Transfer Protocol it will break.

Adding a CLI command for both wouldn't be a lot of extra work.

Let's hold on with that and keep the scope minimal for now. It's difficult enough to keep up with maintaining the existing Playground implementations.

For now I'm going to look at the ways it's possible to import/export and add that to the docs.
Check back to the issue for updates when the tasks are completed.

@flexseth flexseth moved this from Todo to In Progress in Playground Documentation Apr 12, 2024
@flexseth
Copy link
Collaborator Author

I'll be working on these docs for the Yoast contributor day!

@flexseth
Copy link
Collaborator Author

Functioning example on the Blueprints Gallery page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: In Progress
Development

No branches or pull requests

3 participants