drush sql dump and table prefixes
alberto56 - November 7, 2009 - 01:48
| Project: | Drush |
| Version: | All-Versions-HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi, I have a Drupal installation with about 20 sites on a single database, each with its own table prefix. When using
drush -l example.com sql dump > example.com.sqlit dumps the entire database, not just those tables having to do with example.com. The current functionality is useful most of the time, but in certain circumstances (for example, when migrating a site) it might be useful to limit the dump to exactly those tables used in the target site. So far I haven't found a way to easily do this through drush.
(Backup and Migarte allows one to do this, but it has to be configured for each site. An out-of-the-box solution with Drush would be nice!)
Cheers and thanks for your work,
Albert.

#1
I might also add that
drush sql dump example.com target.com, and its predecessor,drush sql load, will have potentially disastrous effects if the source and target use table prefixes (may migrate more than intended), and won't work at all if 'source' and 'target' have different table prefixes.This is kind of a hard problem. Since I am not fond of table prefixes myself, I don't imagine that I will have time to tackle it myself in the near future, but I admit that it would be a desirable feature to have.
(@albert: Disclaimer: I am not a drush maintainer, I just submit sql patches here and there.)