WordPress.org

Make WordPress Core

Opened 7 years ago

Last modified 3 years ago

#3632 new enhancement

Export gzip support

Reported by: PozHonks Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.1
Component: Import Keywords: 2nd-opinion
Focuses: Cc:

Description

The ticket may be similar to #3178, but it is not, because we control the WordPress process.

Importing a wordpress.xml file to another wordpress may fail due to an upload_max_filesize and post_max_size directives in php.ini. You know that many web hosts allow only an upload_max_filesize of 2 MB. Though, compression is a great help.

A simple solution is, on one side, offering an option to compress in GZ format the xml file when exporting, and, on the other side, the WordPress importer will accept the compressed file.

And, when possible, WordPress importer should accept compressed files from other formats and blogs.
Just say you only accept one compression format (gz, zip, etc) and the user will comply.

Attachments (2)

gzip-export.diff (1.9 KB) - added by DerFichtl 7 years ago.
gzip export feature
3632.diff (2.7 KB) - added by solarissmoke 3 years ago.

Download all attachments as: .zip

Change History (24)

comment:1 PozHonks7 years ago

  • Type changed from defect to enhancement

Or, if the compression method is not implemented, an alternative to the upload function would be to give the URL of the file.
So, we can upload by FTP the exported file somewhere, then give its URL, like with the RSS importer.

comment:2 Viper007Bond7 years ago

Might also be worth removing line breaks and stuff. People probably don't need to be manually editing the file anyway.

comment:3 Viper007Bond7 years ago

That is if they aren't already removed...

comment:4 foolswisdom7 years ago

  • Milestone changed from 2.2 to 2.4

comment:5 scoop09017 years ago

  • Priority changed from low to high
  • Severity changed from minor to major
  • Type changed from enhancement to defect

For WP-to-WP imports, using a 5meg file WP2.12 exported, I cannot import the file into a new blog using WP2.13. This isn't only limited to "large" files. I checked with my Webhost and they said that uploading a 5meg file is an issue.

I get 'no' errors, though, when the process ends. I've bugged about the WP-to-WP error, and would really like to see this resolved -- but much soonere than the milestone shown below -- 2.4.

comment:6 follow-up: Otto427 years ago

Could we add support for gzipped output and input files? *.xml.gz, basically? Given that it's XML/Text, it compresses really well, and this might solve the huge file problem for the short term.

comment:7 in reply to: ↑ 6 Otto427 years ago

Replying to Otto42:

Could we add support for gzipped output and input files? *.xml.gz, basically? Given that it's XML/Text, it compresses really well, and this might solve the huge file problem for the short term.

Never mind. Already suggested. Shows what I get for not reading the complete ticket.

comment:8 Otto427 years ago

Changing this:

$importdata = file($this->file); // Read the file into an array

to this:

if ( extension_loaded('zlib') && substr($this->file, -3) == '.gz') {
	$importdata = gzfile($this->file); // Read the file into an array
} else {
	$importdata = file($this->file); // Read the file into an array
}

In the get_entries() function in wp-admin/import/wordpress.php should do the trick for importing gzip compressed files.

Sending back gzip compressed output is trickier. I don't think ob_gziphandler will work in export.php, because of the header thing. Worth a try though, maybe some testing is in order.

comment:9 ShahabJafri7 years ago

If we could get an option whether to export Comments or Posts Meta (Like custom fields ), the size of exported file can be greatly reduced. I was having Kramer earlier (discontinued after upgrading from WordPress 1.5 though) and I found that Kramer created shitload of custom fields and expanded the database size .. I removed everthing related to Kramer from Post2meta and my xml size came down to 1.8 mb ..

DerFichtl7 years ago

gzip export feature

comment:10 DerFichtl7 years ago

i have added a checkbox to the export screen and the logic for gzip compress via ob_gzstart callback. maybe it helps. see attachement gzip-export.diff

comment:11 DerFichtl7 years ago

  • Keywords has-patch needs-testing added

comment:12 lloydbudd7 years ago

  • Summary changed from WordPress to WordPress import fails with big files to Export gzip support

Duplicate #5485

comment:13 westi6 years ago

  • Milestone changed from 2.5 to 2.6

2.5 is Feature Frozen - Push to 2.6

comment:14 jacobsantos6 years ago

  • Type changed from defect to enhancement

comment:15 FFEMTcJ5 years ago

Also see #6467 which suggests another way to do this.

comment:16 Denis-de-Bernardy5 years ago

Imo, it's a better idea to tell the user to upload the file into the site's home dir, and to proceed with the import from there.

comment:17 Denis-de-Bernardy5 years ago

  • Keywords changed from has-patch, needs-testing to has-patch needs-testing

comment:18 Denis-de-Bernardy5 years ago

  • Keywords needs-patch added; has-patch needs-testing removed
  • Milestone changed from 2.9 to Future Release

broken patch

comment:19 Denis-de-Bernardy5 years ago

  • Component changed from Administration to Import
  • Priority changed from high to normal
  • Severity changed from major to normal

solarissmoke3 years ago

comment:20 solarissmoke3 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

Added a patch to allow gzip exporting. This works for me but will need testing across platforms because output buffering always seems a bit wobbly.

comment:21 follow-up: nacin3 years ago

Should probably follow what we've done in load-scripts.php and load-styles.php. Also need to make sure the importer can accept this.

For what it's worth, not convinced on this, I'm only talking from a technical perspective. I would rather offer better chunking or a better bridge between installs, perhaps as a wordpress.org service.

comment:22 in reply to: ↑ 21 solarissmoke3 years ago

  • Keywords 2nd-opinion added; has-patch needs-testing removed

Replying to nacin:

Should probably follow what we've done in load-scripts.php and load-styles.php. Also need to make sure the importer can accept this.

Okay - that looks more robust. Maybe I'll wait until there is sufficient agreement that this is worth pursuing in the first place.

Note: See TracTickets for help on using tickets.