Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to port over a Drupal commons 6x24 from a local LAMP-stack to a production webserver. Both systems run OpenSuse Linux. How do I do this, what are the most important steps. How should I handle file-ownership.

It's important for me to have to have full control of the file ownership. If I use the wwwrun account, I frequently run into problems, due to a very strict webserver-admin.

See for example the long history of looking for fixes and solutions see this thread and even more interesting see this very long and impressive thread here.

All troubles I run into have to do with file-owernship and permissions. This is my current setup; Note: This was just a quick hacked installation - quick and dirty. Well my interest is after the general options i have in the port of a drupal from linux to linux

linux-vi17:/srv/www/htdocs/com624 # ls -l
insgesamt 224
-rwxrwxrwx  1 root www 45285 19. Jan 00:54 CHANGELOG.txt
-rwxrwxrwx  1 root www   925 19. Jan 00:54 COPYRIGHT.txt
-rwxrwxrwx  1 root www   206 19. Jan 00:54 cron.php
drwxrwxrwx  2 root www  4096 19. Jan 00:54 includes
-rwxrwxrwx  1 root www   923 19. Jan 00:54 index.php
-rwxrwxrwx  1 root www  1244 19. Jan 00:54 INSTALL.mysql.txt
-rwxrwxrwx  1 root www  1011 19. Jan 00:54 INSTALL.pgsql.txt
-rwxrwxrwx  1 root www 47073 19. Jan 00:54 install.php
-rwxrwxrwx  1 root www 15572 19. Jan 00:54 INSTALL.txt
-rwxrwxrwx  1 root www 14940 19. Jan 00:54 LICENSE.txt
-rwxrwxrwx  1 root www  1858 19. Jan 00:54 MAINTAINERS.txt
drwxrwxrwx  3 root www  4096 19. Jan 00:54 misc
drwxrwxrwx 35 root www  4096 19. Jan 00:54 modules
drwxrwxrwx  4 root www  4096 19. Jan 00:54 profiles
-rwxrwxrwx  1 root www  1470 19. Jan 00:54 robots.txt
drwxrwxrwx  2 root www  4096 19. Jan 00:54 scripts
drwxrwxrwx  4 root www  4096 19. Jan 00:54 sites
drwxrwxrwx  7 root www  4096 19. Jan 00:54 themes
-rwxrwxrwx  1 root www 26250 19. Jan 00:54 update.php
-rwxrwxrwx  1 root www  4864 19. Jan 00:54 UPGRADE.txt
-rwxrwxrwx  1 root www   294 19. Jan 00:54 xmlrpc.php
linux-vi17:/srv/www/htdocs/com624 # 

thx to BetaRides answer here a quick overview on the drush functionality with rsync

http://drush.ws/

core-rsync

Rsync the Drupal tree to/from another server using ssh.

Examples:
 drush rsync @dev @stage                   Rsync Drupal root from dev to stage 
                                           (one of which must be local).       
 drush rsync ./ @stage:%files/img          Rsync all files in the current      
                                           directory to the 'img' directory in 
                                           the file storage folder on stage.   


Arguments:
 source                                    May be rsync path or site alias. See 
                                           rsync documentation and              
                                           example.aliases.drushrc.php.         
 destination                               May be rsync path or site alias. See 
                                           rsync documentation and              
                                           example.aliases.drushrc.php.         


Options:
 --mode                                    The unary flags to pass to rsync;    
                                           --mode=rultz implies rsync -rultz.   
                                           Default is -az.                      
 --RSYNC-FLAG                              Most rsync flags passed to drush     
                                           sync will be passed on to rsync.     
                                           See rsync documentation.             
 --exclude-conf                            Excludes settings.php from being     
                                           rsynced.  Default.                   
 --include-conf                            Allow settings.php to be rsynced     
 --exclude-files                           Exclude the files directory.         
 --exclude-sites                           Exclude all directories in "sites/"  
                                           except for "sites/all".              
 --exclude-other-sites                     Exclude all directories in "sites/"  
                                           except for "sites/all" and the site  
                                           directory for the site being synced. 
                                            Note: if the site directory is      
                                           different between the source and     
                                           destination, use --exclude-sites     
                                           followed by "drush rsync @from:%site 
                                           @to:%site"                           
 --exclude-paths                           List of paths to exclude, seperated  
                                           by : (Unix-based systems) or ;       
                                           (Windows).                           
 --include-paths                           List of paths to include, seperated  
                                           by : (Unix-based systems) or ;       
                                           (Windows).                           


Topics:
 docs-aliases                              Site aliases overview with examples 


Aliases: rsync
share|improve this question
    
Your files permissions seems incorrect, have a look at Securing file permissions and ownership –  tostinni Jan 21 '12 at 11:38
    
this was just a quick hacked installation - quick and dirty. Well my interest is after the general options i have in the port of a drupal from linux to linux –  zero Jan 21 '12 at 14:01
add comment

migrated from drupal.stackexchange.com Jan 21 '12 at 9:58

This question came from our site for Drupal developers and administrators.

1 Answer

up vote 1 down vote accepted

We are successfully using rsync for this. It gives you fine-grained control over permission settings, and how they are transferred from one machine to the other one.

A very nice side effect of rsync is that, once properly set up, it gives you a very nice deployment tool. There's even Drush integration available.

share|improve this answer
    
by the way - how easy can i install drush!? –  zero Jan 21 '12 at 14:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.