Changing the Admin Theme in Drupal 6 Directly in Database - drupal

I'd like to restore the default admin theme in Drupal 6 via the database. Anyone know where this is stored?
Btw, there is a great answer describing how to change your site's public theme in the database here ...I just could not get it to update my admin theme.

List of themes you can find in {system} table, filter by type = theme, there you can set status = 1
Default theme you can find in {variable} table, filter by name = theme_default, change it to you theme name, as it is written in system table (for example, garland, not Garland).
After this clear cache table.

Follow these steps via the db:
{system} table, filter by type=theme
set status=1
{variable} table, filter by
name=theme_default change it to you
theme name, as it is written in
system table
{variable} table, filter by
name=admin_theme change it to you
theme name, as it is written in
system table. Do not skip this step.
truncate cache

Login to your phpMyAdmin, click on SQL tab and run:
UPDATE system SET status=1 WHERE name = 'garland';
UPDATE variable SET value='s:7:"garland"' WHERE name = 'theme_default';
TRUNCATE cache;
Note that you may need to add prefix to your tables
Thanks to https://drupal.org/node/200774

If you're editing the variables in PHPMyAdmin, remember that you're editing a serialized value. This means that the value you're editing looks something like this: 's:7:"garland"'.
If you just changed "garland" to "marvin" that would change the number of letters in the serialized value from seven to six.
You'd need to change 's:7:"garland"' to 's:6:"marvin"'
That is, you'd need to count the number of letters in your new theme, and update the number following s: accordingly.

Related

Woocommerce Modify or Reset total_sales

I want to change or reset the total_sales to 0 at worst.
When I modify in phpMyAdmin (wc_product_meta_lookup) nothing happens and everything goes back to the way it was before after a new order.
I searched for 2 hours without finding anything.
thank you in advance.
total_sales is a post meta field, a row in postmeta table. wc_product_meta_lookup just contains consolidated data from postmeta to avoid making multiple postmeta selects when product data are needed.
postmeta is the source of truth in this case, you need to set your desired value in there. Either directly in the database or using a custom field in the product edit view.
Reports (including total sales value in the dashboard widget) are dynamically generated, so I believe the value your setting in the database will just be set back to it's true value when WordPress runs.
According to the docs, you need to delete all prior orders (permanently) and clear your browser cache for new reports.
More info: https://docs.woocommerce.com/document/reports/#section-12

How do we reset the blog_id count in a WordPress Multisite

I've just cloned all my subsites (40) from one Multisite to another of my Multisite installations. I want to use this opportunity to clean-up/reset the blog counter in my old MU to start at 2 again. Currently the blog counter is at 64 even though i only had 40 subsites. I know its like a primary-key in the db and auto increments with every new subsite created. With all my deletions and tinkerings over the months its left lots of gaps in the indexing numbers. I've found the column 'blog_count' in the wp_sitemeta Db table in MySQL and it currently stands at 40, correctly but i can't believe its the only place that the count exists and don't want to risk mucking about with it. Could it be safely altered??
The next sub-site of the multisite is defined by the AUTO_INCREMENT value of the wp_blogs DB table. It defines the next blog_id primary key. We can find AUTO_INCREMENT in the Operations tab of the table in the phpMyAdmin. But we can't change it to less number than used in the table.
But we can export the wp_blogs table, change it with Notepad++, then delete the table and import the changed table. Actually, I guess we can do it with the whole DB and replace any wp_{old_index}_ to wp_{new_index}_.
The example.
Let's imagine we have sub-sites from index 7 and more. These are steps for changing wp_7_{tables} to wp_2_{tables} (it's the first after the root site):
Make a full backup.:)
Remove all unnecessary sites (for example
wp_8_, etc.). Remove tables with old prefixes too.
Use the Search tab and change all DB fields with wp_7_{filedname} to
wp_2_{filedname}. Because there are some important site's metas with field starting with wp_{n}_{fieldname}.
On the Operation tab rename all DB tables with wp_7_{tablename}
to wp_2_{tablename}.
Change the wp_blogs table increment to 3 (it's next after 2): export the table in the phpMyAdmin, edit it, delete the original, and import the changed table back. The table is small it will easy.
Done. Add the next site with index 3.

Wordpress and plugins (inventor) where posts table is defined

I need to make some work with wordpress 4.9. The table prefix is defined as abc_ and some posts is exists in table abc_posts. But also tables abc_2_posts and abc_3_posts is exists. Site catalog is actually rendered from abc_2_posts. Where this is configured?
This is because you are using a multisite installation. Every site in the network will have a unique id assigned to it. Looking at the table name abc_2_posts the number 2 tells you that this table is used by the site with id 2.

Modifying router.name and router.field after creating a collection

i have created a collection in solr with number of shards=2 and replication factor=2 and while doing that by default solr assigned
router.name=compositeId
but I want to change the name to "implicit" and I also want to specify the value of router.field.
I read somewhere that for doing that you have to edit the file clusterstate.json but I am not able to edit the file.
Can somebody help how to edit this file or is there another way to change my router.name and specify the value of router.field?

How to change entity language in bulk?

I have a site in drupal which is in spanish by default. Now I want to add the english translation. It has a lot of entities "producto" with undefined ('und') language. I want to mass assign the 'es' language to them. Before posting this question I have checked this other question How to change node languages in batches? but I'm unable to accomplish what I want. Let me explain:
a) I have tried Language Assignement but it last commit was 1 year ago and it has a critical bug that can lead to data loss (I reproduced the error too) I also tried with the patch from user barami but the data loss persists.
b) View Bulk Operations: I've tried it, but it does only update the field in database table "node". Not the other ones.
c) So I checked out how the drupal database works and created a sql script which also leads to data loss:
-- Step 1 Node lang
update node set language='es' where type='producto';
-- Step 2 body field
update field_data_body set language='es' where bundle='producto';
-- Step 3 Field comment vody
update field_data_comment_body set language='es' where bundle='comment_node_producto';
-- Step 4 For each field of producto, update language
update field_data_field_precio set language='es' where bundle='producto';
update field_revision_field_precio set language='es' where bundle='producto';
(...)
I have the following translation modules activated:
Internationalization, Block languages, Field translation, Menu translation, Multilingual content, Multilingual select, Synchronize translations, Taxonomy translation, Translation redirect, Translation sets
What Am I doing wrong with my sql script? Are there other plugins to accomplish what I want to do? Any suggestion will be appreciated Thanks!
Here's how I bulk set the language on my site:
Using Views Bulk Optimization, select all nodes you want to change, use the 'Change value' option and then change the value to language you want.
After you've done this, the field values will not appear when editing the nodes, so you need to run a script, e.g. UPDATE database.field_data_body SET language='en' WHERE bundle='page' (use your db name, field name, and bundle as appropriate).
IMPORTANT: If you have any custom url aliases, they will be overwritten with this approach, due to a problem with pathauto, but there's a work-around: first go to /admin/config/search/path/settings, and change the 'Update action' option to 'Do nothing. Leave the old alias intact.', then change this value back once you've run your Views Bulk Operations action.
Assuming you can make a view listing your entities, you can use the Views Bulk Operations module to do this. I just explained how to do this the other day for nodes on Drupal Answers.
Another solution would be to just execute the first SQL because I have discovered that the fields language must remain 'und'.
update node set language='es' where type='producto';

Resources