# Email domains changed when pulling live to local

**URL:** https://community.kinsta.com/t/email-domains-changed-when-pulling-live-to-local/3799
**Category:** Bug Reports
**Created:** [August 12, 2024, 3:12pm UTC](https://community.kinsta.com/t/email-domains-changed-when-pulling-live-to-local/3799 "2024-08-12T15:12:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Andy\_Fish](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/andy_fish/32/2178_2.png) [@Andy\_Fish](https://community.kinsta.com/u/Andy_Fish)
#### Post date: [August 12, 2024, 3:12pm UTC](https://community.kinsta.com/t/email-domains-changed-when-pulling-live-to-local/3799/1 "2024-08-12T15:12:08Z")

</div>

**Q: Date/Time this occurred (Provide your time zone also)**  
**A:** August 12, 2024 11:00am EDt

**Q: DevKinsta Version**  
**A:** 2.13.2 (2.13.2.8698)

**Q: OS Version**  
**A:** MacOS 14.6

**Q: Docker Desktop Version**  
**A:** 4.33.0

**Q: Were any error codes or messages observed? If so, what were they?**  
**A:** No

**Q: Detailed Description of the Problem**  
**A:**

Pulling from my life site to local on DevKinsta, all references to [domain.com](http://domain.com) seem to be replaced with domain.local (noted in email settings and logs for Post SMTP). When pushing from local to stage, domain.local is being replaced with [stage.domain.com](http://stage.domain.com). Then, when I push from stage to live, [stage.domain.com](http://stage.domain.com) is not being replaced with [domain.com](http://domain.com).

This breaks the ability to send emails from the site using Post SMTP and Sendgrid because neither domain.local or [stage.domain.com](http://stage.domain.com) are valid email sending domains.

I see on the discussion topics that this was supposedly resolved with DevKinsta 2.13.1 to ignore any “@domain.com” references, but I am still seeing this happen in the latest version.

---

<div class="post-metadata">

### Author: ![Adrian\_L](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/adrian_l/32/2810_2.png) [@Adrian\_L](https://community.kinsta.com/u/Adrian_L)
#### Post date: [August 13, 2024, 3:11am UTC](https://community.kinsta.com/t/email-domains-changed-when-pulling-live-to-local/3799/2 "2024-08-13T03:11:54Z")

</div>

Hi @Andy_Fish 👋

It looks like the main issue is related to pushing from Staging to Live. Can you please verify if the staging domain “[stage.domain.com](http://stage.domain.com)” is set as the primary domain on staging? This is important because when pushing from Staging to Live, the process will only search and replace the primary domain of the staging site with the primary domain of the live site.

Since this issue is primarily between Staging and Live, you can also contact our support team via live chat for immediate assistance in reviewing the Search and Replace process during the Staging push. [Contact Kinsta®](https://kinsta.com/contact-us/)

---

<div class="post-metadata">

### Author: ![Andy\_Fish](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/andy_fish/32/2178_2.png) [@Andy\_Fish](https://community.kinsta.com/u/Andy_Fish)
#### Post date: [August 13, 2024, 12:13pm UTC](https://community.kinsta.com/t/email-domains-changed-when-pulling-live-to-local/3799/3 "2024-08-13T12:13:23Z")

</div>

Hi @Adrian_L,

Yes, [stage.domain.com](http://stage.domain.com) is set as primary. I did further tests yesterday and found that the issue seems to be when I pull live to local, [domain.com](http://domain.com) is replaced by domain.local in the database. I confirmed this by looking at the DevKinsta log, which shows the WP CLI search-replace command to change [domain.com](http://domain.com) to domain.local – including the “[noreply@domain.com](mailto:noreply@domain.com)” address stored in the DB.

Then, when I push to the staging site it is replacing domain.local with [stage.domain.com](http://stage.domain.com). But when pushing stage to live, references to [stage.domain.com](http://stage.domain.com) are not being updated to [domain.com](http://domain.com).

If I change the email address back to [noreply@domain.com](mailto:noreply@domain.com) and then push to stage, and stage to live, everything is okay. The primary issue as I see it is email address are modified in the DB when pulling live to local.

---

<div class="post-metadata">

### Author: ![Adrian\_L](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/adrian_l/32/2810_2.png) [@Adrian\_L](https://community.kinsta.com/u/Adrian_L)
#### Post date: [August 14, 2024, 12:07am UTC](https://community.kinsta.com/t/email-domains-changed-when-pulling-live-to-local/3799/4 "2024-08-14T00:07:18Z")

</div>

Hi @Andy_Fish,

Thank you for the additional clarification. I am able to replicate this behavior as well.

Essentially, when pulling or pushing content between local (DevKinsta) and Live/Staging, the Search and Replace script changes the _ **@primarydomain.com** _ entries in the database. However, when pushing between Live and Staging, _ **@primarydomain.com** _ is skipped. Unfortunately, this is currently the expected behavior, but I understand that this is causing issues in your current workflow.

We’ve reported this to our developers to hopefully also skip _ **@primarydomain.com** _ when doing push/pull between local (DevKinsta) and Live/Staging, but we cannot promise any ETA.

As a workaround, after pushing from local to Staging, then Staging to Live, you may run another Search and Replace using our [tool](https://kinsta.com/docs/wordpress-hosting/mykinsta-tools/mykinsta-search-replace-tool/) for changing _ **@stage.domain.com** _ to _ **@domain.com** _ in the Live site.

I hope this information is useful. Let us know if you have any additional question/clarification. 🙂
