I just used drush rsync and drush sql-sync to move a drupal 6 site from production to development.

It worked extremely well, other than an issue with permissions. The production site had the owner as nobody (Apache, I believe), while the development site had the owner as a user. Until I played around with permissions, the test site wouldn't work.

I assume there are various options, including changing owners or making sure that rsync doesn't overwrite permissions? What would people recommend, assuming the site might move back and forth between production and development from time to time?

I realize that this might not, technically, be a drush question (other than the possibility of making sure that drush doesn't transfer permissions that won't work with a different owner), but drush is potentially so useful for this scenario that it would be great to document how to handle this scenario in one place.

Comments

greg.1.anderson’s picture

I answered this question once already; please search the issue queue and see if you can find it. If you do, I'll turn it into an entry in drush topic.

greg.1.anderson’s picture

Title: Best practice in permissions using drush between production and development » Add a `drush topic` entry for best practice in permissions using drush between production and development
Component: Miscellaneous » Documentation
Assigned: Unassigned » greg.1.anderson

See #990812: Add a "permissions" subcommand to fix/set all file permissions, which points to #1169778-#16, which is the issue I was referring to in #1.

greg.1.anderson’s picture

I might also mention that the above issue does not mention the git workflow, which is another very useful way to move files between sites. The permission issues are similar with git, so the above is still applicable to the git workflow.

greg.1.anderson’s picture

I might want to wait for the resolution of #1342940: Simplify documentation for shell alias replacements before I write docs on how to move files around using drush.

moshe weitzman’s picture

Category: support » feature
Priority: Normal » Major

This is a nice to have item for drush5

greg.1.anderson’s picture

I've been meaning to do this for almost a year now. :p I quickly wrote a couple more comments about this on SE today: http://drupal.stackexchange.com/questions/45321/permissions-and-ownershi...

greg.1.anderson’s picture

Some additional sample code available in #841310: How to change permissions and owner after dl / update?.

greg.1.anderson’s picture

Version: All-versions-4.2 » 8.x-6.x-dev
Status: Active » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.