Wp-calypso: Import: improve the import flow when you export as ZIP yet require an unzipped XML file to import

Created on 1 Jul 2016  Â·  15Comments  Â·  Source: Automattic/wp-calypso

Steps to reproduce

  1. Go to /settings/export, export and download the resulting zip archive.
  2. Go to /settings/import, import the zip.
  3. You should now see this error message:
    2016-07-01 10 55 53

While our importer only takes WXR file, a user could legitimately assume she can import whatever exported directly.

It would be less confusing to show clearer instructions to inform the user to extract and to upload WXR files individually.

FixTheFlows Import [Type] Enhancement

Most helpful comment

If we can patch the client to get the zip file to PHP, we can extract only appropriate files by passing them to the 2nd param of ZipArchive::extractTo.

All 15 comments

Agreed. It would be nice to detect an uploaded zip file and let someone know that they should unzip first and upload the xml file instead.

I saw a different error when I tested this. I'm including it here for reference:

Unexpected error during the upload

screen shot 2016-08-19 at fri aug 19 1 20 26 pm
Seen at https://wordpress.com/settings/import/foodescapades.wordpress.com using Chrome 52.0.2743.116 on Mac OS X 10.11.6

Wanted to say +1 to fixing this UX issue.

@m mentioned this one again recently — adding more notes here.

UX issue: When you download an export from WP.com, you end up with a ZIP file. But if you try to upload that ZIP file to import somewhere else on WP.com, it errors because the import needs an unzipped .xml file and not the ZIP format.

This issue has been marked as stale and will be closed in seven days. This happened because:

  • It has been inactive in the past 9 months.
  • It isn't a project or a milestone, and hasn’t been labeled `[Pri] Blocker`, `[Pri] High`, `[Status] Keep Open`, or `OSS Citizen`.

You can keep the issue open by adding a comment. If you do, please provide additional context and explain why you’d like it to remain open. You can also close the issue yourself — if you do, please add a brief explanation.

@Automattic/delta-samus, this should be pretty straightforward. Let's fix it.

What's preventing us from allowing the zip to be uploaded and extracting the XML on the server? It seems like that would be a better experience than asking the user to unzip it themselves.

We could do some checks to ensure that the zip only contains an appropriate import file as a security measure.

@pablinos Actually I had proposed it in https://github.com/Automattic/hg/issues/147#issuecomment-229545699 . The only reason we didn't aim for that was because we simply didn't have the bandwidth. Sarcastically, we still don't have the bandwidth even after we scoped it down 🙃

If we implement zip uploading, I think we should still support WXR uploading and provide clear instructions that both uploading a zipped WXRs archive and a WXR will work.

If we can patch the client to get the zip file to PHP, we can extract only appropriate files by passing them to the 2nd param of ZipArchive::extractTo.

Tagging @Automattic/delta-samus on this one as it came up again yesterday in an empathy challenge posted by @m.

@bisko is working some magic in D16447-code

Ran into this today in #8049949-hc.
The user was attempting to upload the enclosing file folder, rather than the zip or the .xml. This is because when a site is exported, a zip is downloaded and some OS open these automatically.
Then you have the zip archive, the enclosing folder, and the .xml file within.

Uploading the enclosing folder results in this error:
importerror

Whatever error we display here should specify the acceptable filetype(s) the importer will accept.
It would also be helpful to specify this below the importer in the first place. "Upload a WordPress export file" doesn't help someone who doesn't know what a WordPress export file means.
Adding specific filetype(s) here would be great.

@thehenrybyrd Seems like an XML file in the Zip archive was having broken encoding. We have a fix in place for testing, but it's not fully released to the public.

You can enable the feature for the customer's site and let them try the import again.

More information here: p7DVsv-5Hb-p2

Hey I know this issue has been stale for a while, but thought I could help out:

ZIP and WXR are both supported now, and the UI copy had been updated a while back to indicate that:
Screen Shot 2019-06-12 at 2 50 12 PM

Next, to add specificity to the upload error message, I re-iterate what a valid export file is:
Screen Shot 2019-06-12 at 3 14 10 PM

Lastly, when a user contacts support, I propose to make that link more specific and skip the self-serve articles and go straight to /help/contact:
Screen Shot 2019-06-12 at 3 23 05 PM

I got feedback on the proposed solution, to not link the message directly to support, but to keep the link as-is, pointing to the Help section. In that case, I changed the original error message for accuracy, since that wasn't contacting support either:

Screen Shot 2019-06-13 at 3 25 01 PM

Thanks for tackling this, @dezzie 🙇

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marianearchimbaud picture marianearchimbaud  Â·  52Comments

jonnyruzek picture jonnyruzek  Â·  40Comments

cpapazoglou picture cpapazoglou  Â·  64Comments

supernovia picture supernovia  Â·  49Comments

KristinaKay picture KristinaKay  Â·  134Comments