# Automatically transferring themes

**URL:** https://meta.discourse.org/t/automatically-transferring-themes/180272
**Category:** Support
**Created:** [February 18, 2021, 11:26pm UTC](https://meta.discourse.org/t/automatically-transferring-themes/180272 "2021-02-18T23:26:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![AlexJC](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AlexJC](https://meta.discourse.org/u/AlexJC)
#### Post date: [February 18, 2021, 11:26pm UTC](https://meta.discourse.org/t/automatically-transferring-themes/180272/1 "2021-02-18T23:26:47Z")

</div>

Hi,

Is there any mechanism (or query) that could easily take everyone who currently has enabled Theme ID X and swap them to Theme ID Y.

I currently have Theme X which is a bunch of messy components and want to replace it with an identical Theme Y which will be linked to GitHub. But I don’t want everyone who has chosen Theme X to notice any difference (i.e. I can’t just delete it and tell them all to pick Y).

Any help would be appreciated 😁

---

<div class="post-metadata">

### Author: ![AlexJC](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AlexJC](https://meta.discourse.org/u/AlexJC)
#### Post date: [February 18, 2021, 11:45pm UTC](https://meta.discourse.org/t/automatically-transferring-themes/180272/2 "2021-02-18T23:45:51Z")

</div>

I guess I could import the GitHub theme as a new component and make it the only component of Theme X. (at least I think that would work?) But that doesn’t seem the most elegant solution.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 19, 2021, 12:08am UTC](https://meta.discourse.org/t/automatically-transferring-themes/180272/3 "2021-02-19T00:08:48Z")

</div>

This should do it, but you should make a backup first.

### get into rails

```plaintext
cd /var/discourse
./launcher enter app

```

#### do these commands

```plaintext
old_id=2
new_id=21
UserOption.where(theme_ids: [old_id]).update_all(theme_ids: [new_id])

```

---

<div class="post-metadata">

### Author: ![AlexJC](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AlexJC](https://meta.discourse.org/u/AlexJC)
#### Post date: [February 19, 2021, 12:26am UTC](https://meta.discourse.org/t/automatically-transferring-themes/180272/4 "2021-02-19T00:26:08Z")

</div>

Great, cheers!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [March 21, 2021, 12:26am UTC](https://meta.discourse.org/t/automatically-transferring-themes/180272/5 "2021-03-21T00:26:09Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
