Moving a Drupal between linux servers, best practice to avoid file-ownership problems
- by zero
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