- Issue created by @2dareis2do
- π¬π§United Kingdom 2dareis2do
Just looking into this in a little more detail. I can see that in config table I can filter items like so:
SELECT * FROM db.config WHERE name LIKE 'search_api%';
This actually returns 45 different rows that all seem relevant. However the one mentioned previously looks like we have
search_api.server.server_id where server_id seems to be the actual name of the server. This also has blob attached which I presume where the rest of the config is stored (need to confirm).
So in this case I could just skip this row in config table or even use a wildcard to skip all rows (as in the sql statement above).
Same logic could be applied to other modules where we do not want to sync the config.
- π¬π§United Kingdom 2dareis2do
just to follow up ion this I can see there are few areas this could be added
1.
$result = $this->query("SELECT * FROM `" . $table['name'] . "`");
in _dumpTableSqlToFile function in web/modules/contrib/backup_migrate/src/Core/Source/MySQLiSource.php2.
_getTableCreateSql
3.
exportToFile
- π¬π§United Kingdom 2dareis2do
Ok I have created a patch that allows you to skip config when using backup_migrate.
I had to modify the export to use REPLACE rather than DROP TABLE CREATE TABLE and INSERT. Therefore this should so should be used with this in mind. e.g. It may not be a good idea if copying across environments for the first time as the schema will likely need to be created first, which we are also skipping when using REPLACE.
Using REPLACE allow us to skip row while keeping the original ones in place so that values can be mixed and matched from environments.
If no config items are selected, it should handle the config table as before.
I will also try and create a MR and hopefully get some feedback when I can, but it easier for me to create a patch for now.
- last update
12 months ago Patch Failed to Apply - last update
12 months ago Patch Failed to Apply - last update
12 months ago Patch Failed to Apply - last update
12 months ago Patch Failed to Apply - last update
12 months ago Patch Failed to Apply - last update
12 months ago 25 pass - last update
12 months ago 25 pass - last update
12 months ago 24 pass, 2 fail - last update
12 months ago 25 pass - last update
12 months ago 25 pass - last update
12 months ago 24 pass, 2 fail - π¬π§United Kingdom 2dareis2do
Ok I have fixed tested this and also fixed an issue when selecting multiple rows.
My Test was to copy exclude all search_api rows from config table. When restoring the search api setting are unaltered. π
- πΊπΈUnited States DamienMcKenna NH, USA
I've always managed this by overriding the configuration in a per-hostname settings.local.php file, is that not the standard practice?
- π¬π§United Kingdom 2dareis2do
@danienmckenna, that could work as well. Quite a lot of setting around this for search api. I have not tried that but sounds feasible.
Probably the standard practice is to use config api with config split or something similar.
Simple alternative is to use backup and migrate.
- πΊπΈUnited States DamienMcKenna NH, USA
I feel like this is getting too granular into B&M's customizability, especially when there are other reliable solutions. As such I'm inclined to mark this as "won't fix".
- π¬π§United Kingdom 2dareis2do
Thats a shame.
I have been using this myself and find it very useful.
Managing with the other options really requires CI which is not always available, especially on smaller sites.
Like backup and migrate, this feature is very useful for smaller sites, especially if you use search_api with solr. In fact most modules use config table for settings.
Do you see any technicalities with this, especially around the implementation. Is there a better way to implement this?
- π¬π§United Kingdom 2dareis2do
I am getting the following when using normal backup.
TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 377 of /httpdocs/web/modules/contrib/backup_migrate/src/Core/Source/MySQLiSource.php).
Probably need to test this as well here.
- last update
10 months ago Composer require failure - last update
10 months ago 25 pass