How to preserve Drupal file permissions after compressing and moving as tarball?
I move sites as tarballs between servers fairly often when I can't deploy with rsync or git.

According to the man page:


  -p, --preserve-permissions extract information about file permissions (default for superuser)


is the proper option to use.  However, this never works well for me.

Typically, I will just use normal tar options, and then run a script after the fact to fix things up.  

The Securing file permissions and ownership article has a very good script.  As that gets adjusted from time to time, I am not going to reproduce it here.  It essentially does some find/chown/chmods on the tree to fix things up.

I would use this script as a starting point for your needs.  One thing that it doesn't address is having the private:// filesystem outside of docroot, which I always use.  I will also use 2775 as the permission for the public:// path, as well as a separate use for core/contrib and the site specific code.