GoogleForCreators / web-stories-wp

Web Stories for WordPress
https://wp.stories.google
Apache License 2.0
768 stars 178 forks source link

Export and import for templates/stories #4357

Open marbd3 opened 4 years ago

marbd3 commented 4 years ago

Feature Description

An export and import of the template feature is missing will it be added anytime soon?


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance Criteria

Implementation Brief

ernee commented 4 years ago

@marbd3 great suggestion! We've been discussing some export possibilities in this issue as well.

How would you use an export/ import feature?

Would it be similar to the request linked to export the assets used in the story or would it be more for importing/ exporting a story (template) from one WordPress site to another?

Feel free to elaborate and we'll share this with the team!

theMikebal commented 3 years ago

I think the challenge is that people are already building stories for other social channels from a mobile device or on another platform. Getting the assets from the cloud and then into WP is another step and then rebuilding the whole thing for web feels too duplicative. It would be great to see this functionality exist or work in a way where social media sharing tools or automation platforms like Zapier could allow users to take out some of the duplicity.

dreamofabear commented 3 years ago

This could also be generalized for stories to support one or multiple stories to be exported into a file and imported into a different WP instance.

dreamofabear commented 3 years ago

Relevant support thread: https://wordpress.org/support/topic/copy-story-to-another-instance/

mxbclang commented 2 years ago

Noting that we've received a few requests for this in support recently:

mikezielonka commented 2 years ago

Just adding in a unique edge. I'm taking a 4 site Wordpress multisite to 1 single site. It's been a real struggle finding a workflow to export and import the stories from the sites into the new instance.

swissspidy commented 2 years ago

@mikezielonka Thanks for sharing your experience. Curious, are you also struggling to finding a workflow for importing regular posts? If not, why is importing stories more difficult?

mikezielonka commented 2 years ago

@swissspidy

WP All Export, the Core Exporter, and Migrate DB Pro don't offer a way to create an export that can be:

1 - Merged 2 - Include the post_content_filtered column with the data needed from wp_posts and wp_postmeta

mikezielonka commented 2 years ago

Did an Export using WP Import and WP All Export. The great support from those guys helped me thru getting posts_content_filtered included in the migration. I have the data there but the editor still shows blank.

Is this because the ID of the web story changed between staging and production?

swissspidy commented 2 years ago

Glad to hear you're making progress!

Did you also include post_content and post meta?

IDs shouldn't really matter to the plugin, but of course something else could have happened to trip up WP itself.

Hard to say without a DB dump or something.

mikezielonka commented 2 years ago

@swissspidy

Here is a quick data dump. I'd love to find a better way so that the many people who run into this have a basic workflow. 🤓

Here is a DB dump of one row: https://s.mikezielonka.com/yAukkq9o

Sample editor url on prod https://flavor-feed.com/wp-admin/post.php?post=3822&action=edit#page=%25221008f12a-d03d-4156-bad6-4a0a8c1b3900%2522

Sample editor url on staging https://flavor-feedcom.bigscoots-staging.com/wp-admin/post.php?post=3597&action=edit#page=%252295ab01c4-218f-402d-9b65-c5ec19b29a2b%2522

Prod Web story https://flavor-feed.com/web-stories/sheet-pan-mac-and-cheese/

Staging Web Story https://flavor-feedcom.bigscoots-staging.com/web-stories/sheet-pan-mac-and-cheese/

note some of the images on prod likely are broken due to needing to regenerate thumbnails. :)

mikezielonka commented 2 years ago

@swissspidy any thoughts on what else I could attempt to get the web stories editor to work with the migrated stories?

swissspidy commented 2 years ago

It looks like the issue in your case is that the escaping of double quotes of the JSON content in the post_content_filtered column somehow got broken/missing.

You can test this yourself by taking the contents of the post_content_filtered column, unescaping it and running it through a JSON formatter/validator.

Because it's invalid JSON, it can't be parsed and thus the story_data column in the REST API will be empty (see https://flavor-feed.com/wp-json/web-stories/v1/web-story/3822?_fields=id,title,story_data for example)

Screenshots showing missing double quotes:

Screenshot 2022-02-06 at 13 34 15 Screenshot 2022-02-06 at 13 30 43

Here's how it should be:

Screenshot 2022-02-06 at 13 31 26

Notice how the block quotes of the HTML attribute are escaped with a backslash.

tl;dr: Fix the JSON to make sure it's valid, then everything should be fine.

mikezielonka commented 2 years ago

@swissspidy

Very Very odd. I didn't even think to check the JSON. Was able to fix that up and restore the story.

If I'm able to pinpoint where that is coming from, I'll log an issue in the appropriate place.

The other issue I ran into was with some images showing up as broken links. That could be a side effect of the staging site.... still need to dig in there.

Thank you so much!

mdotk commented 2 years ago

I think the challenge is that people are already building stories for other social channels from a mobile device or on another platform. Getting the assets from the cloud and then into WP is another step and then rebuilding the whole thing for web feels too duplicative. It would be great to see this functionality exist or work in a way where social media sharing tools or automation platforms like Zapier could allow users to take out some of the duplicity.

Following this issue along. The above sums it up nicely for me!

mariyanh commented 2 years ago

Has someone managed to export/import stories so far with some plugin? Just to mention that I don't want to export/import the whole database...

Once I used some plugin for exporting custom post types and did the job but I don't remember it now.

Thanks...

mikezielonka commented 2 years ago

Nope! On Apr 13, 2022, 2:44 AM -0500, mariyanh @.***>, wrote:

Has someone managed to export/import stories so far with some plugin? Just to mention that I don't want to export/import the whole database... Once I used some plugin for exporting custom post types and did the job but I don't remember it now. Thanks... — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

skimboardbr commented 2 years ago

Hello Any news?

I am very interested in exporting Stories from other tools/plugins and importing them into Google Web Stories

swissspidy commented 2 years ago

Importing from other story creation tools is not possible as all these tools use different data formats.

sourcer18 commented 2 years ago

Hello, any news? . I am very interested in this product improvement. Thank you!

PabloParra95 commented 2 years ago

Hello, I'm using this plugin and it would be a very good improvement if they implement the export and import of Web Stories. I'm looking forward to seeing this soon.

alonsoaguirreazorin commented 2 years ago

This improvement is just that I need to use the plugin in my web farm!

miguelangel812 commented 2 years ago

It would be great to have this product upgrade. Thank you!

JorgeVilchez95 commented 2 years ago

Hi! I would love to see this functionality added, I need it. Thank you!

swissspidy commented 2 years ago

If you‘re interested in seeing this feature, please add an emoji reaction to the original issue description at the top instead of leaving comments. It‘s less noisy.

sourcer18 commented 2 years ago

If you‘re interested in seeing this feature, please add an emoji reaction to the original issue description at the top instead of leaving comments. It‘s less noisy.

nice job Pascal!

bmattb commented 2 years ago

Added the NC label as this is something that team is also now requesting

wmosquini2 commented 2 years ago

I was able to export WebStories with a little help from Adam.

I had already managed to import the content, but the Stories were not displayed in the editor, even though the content was there. That's where Adam gave the light at the end of the tunnel commenting that the Wordpress export tool doesn't export the "post_content_filtered" bank column. To solve it, I created a query to export the column data from the old bank and imported it into the new one. Of course, it wasn't 100%, but it worked on 98% of the Stories created.

It would be very helpful to include this native export/import tool in the plugin. This is extremely important in cases where it is necessary to create a new installation of Wordpress. Despite being a simple solution, it required good hours of work to reach the final result.

eo48Oakes commented 2 years ago

I was able to export WebStories with a little help from Adam.

I had already managed to import the content, but the Stories were not displayed in the editor, even though the content was there. That's where Adam gave the light at the end of the tunnel commenting that the Wordpress export tool doesn't export the "post_content_filtered" bank column. To solve it, I created a query to export the column data from the old bank and imported it into the new one. Of course, it wasn't 100%, but it worked on 98% of the Stories created.

It would be very helpful to include this native export/import tool in the plugin. This is extremely important in cases where it is necessary to create a new installation of Wordpress. Despite being a simple solution, it required good hours of work to reach the final result.

Hello, can you please share that query you used? I would be so much happy. Thanks in Advance!!

eo48Oakes commented 1 year ago

I was able to export WebStories with a little help from Adam.

I had already managed to import the content, but the Stories were not displayed in the editor, even though the content was there. That's where Adam gave the light at the end of the tunnel commenting that the Wordpress export tool doesn't export the "post_content_filtered" bank column. To solve it, I created a query to export the column data from the old bank and imported it into the new one. Of course, it wasn't 100%, but it worked on 98% of the Stories created.

It would be very helpful to include this native export/import tool in the plugin. This is extremely important in cases where it is necessary to create a new installation of Wordpress. Despite being a simple solution, it required good hours of work to reach the final result.

Hello @swissspidy, please help me to get that query or any alternative method to export/import web stories so that the webstories could be editable.

Thanks

mikezielonka commented 1 year ago

@swissspidy has anything changed with how web stories are storing data in the WP db?

I migrated the post_content_filtered content from a staging site to prod like I've done in the past. I can see the data is safely in the DB for the correct post ID but the editor loads an empty story.

BUT it does display correctly when viewing the story.

swissspidy commented 1 year ago

No, nothing has changed. Your JSON data in the db might be corrupt or something. Please open a new issue if you need assistance with that.

mikezielonka commented 1 year ago

No, nothing has changed. Your JSON data in the db might be corrupt or something. Please open a new issue if you need assistance with that.

Better to open an issue here or on WP dot org?

I confirmed my json was valid several times :)

swissspidy commented 1 year ago

Here on GitHub is fine. Just so we don't add unnecessary noise to this feature request issue here.

So please open a new GH issue with as much information as possible, ideally including a db dump for that specific story, or at least the story URL, so that we have something to work with.

kaushik0x7d2 commented 1 year ago

Hey @swissspidy, is there any update on this feature?

swissspidy commented 1 year ago

Not at this time. Any updates would be posted here.

What is your use case for exporting & importing stories?

kaushik0x7d2 commented 1 year ago

Import custom templates, able to edit it and export the code to add to the website.