HomePhabricator

Provide "--output" flags for "bin/storage renamespace"

Description

Provide "--output" flags for "bin/storage renamespace"

Summary:
Ref T6996. Depends on D16407. This does the same stuff as D16407, but for bin/storage renamespace. In particular:

  • Support writing directly to a file (so we can get good errors on failure).
  • Support in-process compression.

Also add support for reading out of a storage dump subprocess, so we don't have to do a dump-to-disk + renamespace + compress dance and can just stream out of MySQL directly to a compressed file on disk.

This is used in the second stage of instance exports (see T7148).

It would be nice to share more code with bin/storage dump, and possibly to just make this a flag for it, although we still do need to do the file-based version when importing (vs exporting). I figured that was better left for another time.

Test Plan:
Ran bin/storage renamespace --live --output x --from A --to B --compress --overwrite and similar commands.

Verified that a compressed, renamespaced dump came out of the other end.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T6996

Differential Revision: https://secure.phabricator.com/D16410