Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
it would be an nice feature if it is possible to backup only the tables containing the db_prefix stored in the settings.php:
Here is my workaround. I've changed the function "_get_tables()" at the file "destinations.db.mysql.inc":
/**
* Get a list of tables in the db.
*/
function _get_tables() {
global $db_prefix;
$len=strlen($db_prefix);
$out = array();
// get auto_increment values and names of all tables
$tables = db_query("show table status");
while ($table = db_fetch_array($tables)) {
if (substr($table['Name'],0,$len)==$db_prefix) $out[$table['Name']] = $table;
}
return $out;
}
It's only a quick and dirty solution for my problem. Is there a way to put a checkbox for this into the profile creation?
Greetings
Carsten
Comment | File | Size | Author |
---|---|---|---|
#1 | destinations.db_.inc_.patch | 14.55 KB | fietserwin |
#1 | destinations.db_.mysql_.inc_.patch | 3.28 KB | fietserwin |
#1 | destinations.db_.inc_.txt | 19.8 KB | fietserwin |
#1 | destinations.db_.mysql_.inc_.txt | 8.11 KB | fietserwin |
Comments
Comment #1
fietserwinI added support for honorating the $db_prefix (empty, string or array).
The patches attached are based on the March 25 6.x-2.x-dev version.
Basic ideas behind the solution:
Allow for easy editing by using a texarea with 1 specification per line. A method often seen in Drupal, e.g. defining the nodes a block should be visible on
The nodata specification is based on:
I added long help messages, also as some kind of documentation.
Internally I made the following changes:
If you like this new way, I will be glad to further integrate the 2 alternative ways of specifying the tables to backup (the already existing one and my new one). I’m thinking of using the 2 texarea’s with some buttons to fill the 1st texarea. One button to specify all tables (just %, ‘db driven backup’), one to fill it with all tables listed separately listed (old way, ‘fully customizable backup’) and one based on $db_prefix (new way, ‘Drupal $db_prefix based backup’).
However, to do so, some upgrading code will probably be needed to convert the contents of the current selects to content for textarea’s. Also, to further integrate this, more changes will probably be needed, as well as additional tests. I’m willing to help with this as well.
Please contact me personally if you would like me to help add new features and resolve existing issues. I’m an experienced (PHP) programmer and am now trying to get a grip on programming with the Drupal API. IMHO The best way to do so is by working on real world modules, that’s why I want to invest some time in this module.
Comment #2
couturier CreditAttribution: couturier as a volunteer commentedDrupal 6 and Backup and Migrate 6 are no longer supported. Please re-post in the 8.x-4.x-dev branch if still desired.