Sometimes it is really useful to preserve symbolic links inside Drupal root directory while making backup with archive-dump command.

I propose to add --preserve-symlinks option to the archive-dump command.
I have a ready code and will submit a patch.

CommentFileSizeAuthor
#1 preserve-symlnks-1366910-0.patch2.05 KBdanylevskyi

Comments

danylevskyi’s picture

StatusFileSize
new2.05 KB

Hi all!

Here is a patch.
How to use:

  1. Create a symbolic link inside your Drupal root directory.
  2. Execute a command: drush ard --destination=/path/to/backups/test.tar.gz --preserve-symlinks
  3. Check your test.tar.gz file. It must contain the symbolic link from first step.

Regards!

danylevskyi’s picture

Status: Active » Needs review

Forgot to set new status...

moshe weitzman’s picture

seems like a good idea. anyone object?

helmo’s picture

Could be useful in case where you have a large data directory which should not end up in regular dumps.

danylevskyi’s picture

Could be useful in case where you have a large data directory which should not end up in regular dumps.

Absolutely true!

danylevskyi’s picture

Also --preserve-symlinks feature will be useful for testing your features or .install files.

Imagine you are developing a module which doing some changes with the database during installation process. Sometimes it is very painful to debug it...

The best way to test it:

  1. Put your module in some place like, ~/modules/my_module
  2. Create symbolic link to this module inside sites/all/modules directory
  3. Then backup your site with drush-archive --preserve-symlinks

Now you can relax and test your .install file or feature as much times as you want. All you need is to restore site with drush-restore command.

moshe weitzman’s picture

Status: Needs review » Fixed

Committed to master and 4.x. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.