Email domains changed when pulling live to local

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 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. Then, when I push from stage to live, stage.domain.com is not being replaced with 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 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.

Hi @Andy_Fish :wave:

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” 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®

Hi @Adrian_L,

Yes, 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 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 to domain.local – including the “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. But when pushing stage to live, references to stage.domain.com are not being updated to domain.com.

If I change the email address back to 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.

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 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. :slightly_smiling_face: