Bulk redirect update from CSV: in code or manually? I have a D7 question. My latest site change involves using the Path Redirect Import module and drush path-redirect-import to bulk-create a bunch of URL redirects from a CSV file. It works fine in dev on my Linux box and I need to deploy it to test on Pantheon.

I'm striving to do code-based deployments, so I use Features and a MYSITE.install module with hook_update_n() calls.

1) Is it a best practice or am I misguided in trying to code a hook_update_n() to perform the DB update? Code-based development aims for recording every developer-initiated site change in code, right? Or are there cases where you don't commit something to code?

2) If the answer is "yes, you should do this in code", then I see that the drush_path_redirect_import function simply processes command-line options and executes:

$result = path_redirect_import_read_file($file, $options);


so I should simply do the same in my hook_update_n(), right?
You either use hook_update_n as you described. Or, sync down TEST to DEV in pantheon, perform the task there as needed, and then sync the DB/code back to TEST from DEV.

The workflow that works best for you depends on whether your site is accessed alot by users and can have no downtime or disruptions, or if your sites workflow/content is more static.