# Pulling from Kinsta - search and replace doesn't work

**URL:** https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345
**Category:** Application Support
**Created:** [April 25, 2024, 9:38am UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345 "2024-04-25T09:38:34Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Joe](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/joe/32/3266_2.png) [@Joe](https://community.kinsta.com/u/Joe)
#### Post date: [April 25, 2024, 9:38am UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/1 "2024-04-25T09:38:34Z")

</div>

Still new to Kinsta and finding my feet with DevKinsta - I’ve been using Local by Flywheel for years now, and so I’m directly comparing to how that works and functions.

When I pull a site from Kinsta, it pulls down successfully, however, the site is full of CSS/JS errors, and I am unable to login to the admin area, as it redirects back to the live Kinsta site. If I check out the database, it appears that no search/replace on the siteurl or home URL has been performed, and it still lists the live sites URL. Looking through the site, it appears that the same is true for all URLs across the site.

I’ve tested this with a few of our sites, and unfortunately the same appears to be true for them all. I searched the forums, and found a similar issue from 2021, so I’d seriously hope that this has been resolved by now.

Thanks,  
Joe

---

<div class="post-metadata">

### Author: ![VladimirM](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/vladimirm/32/2786_2.png) [@VladimirM](https://community.kinsta.com/u/VladimirM)
#### Post date: [April 25, 2024, 1:51pm UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/2 "2024-04-25T13:51:50Z")

</div>

Hello Joe 👋

The search replace process should take place automatically. I tested pulling a site from my Kinsta account and I didn’t need to make any additional changes to make it work on .local address.

It’s possible that Search-Replace is failing. Could you please provide us with the main.log so we can check it?

> **[Troubleshooting - Error Codes - Kinsta® Docs](https://kinsta.com/docs/devkinsta/devkinsta-troubleshooting/error-codes/#viewing-the-application-log-file)**
>
> Find out what error codes may be returned in DevKinsta, what each of them means, and how you can fix them.

Kind regards

---

<div class="post-metadata">

### Author: ![Joe](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/joe/32/3266_2.png) [@Joe](https://community.kinsta.com/u/Joe)
#### Post date: [April 25, 2024, 2:12pm UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/3 "2024-04-25T14:12:03Z")

</div>

Hi Vladimir,

Please find the main.log attached.

_[main.log - redacted]_

Looking through the log myself, I notice that the screenshot generation fails, and I’m also not sure if “isWpSite” ever returns as true, as none of the sites I import (which are all Wordpress) ever allow me to click the WP Admin button in them.

Basically, there’s a whole load of issues that I repeatedly run into when pulling a site from Kinsta.

As I said, this is happening for at least 3 of the sites that I’ve tested, but I’d assume it’s probably true for all of them.

---

<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: [April 26, 2024, 6:05am UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/6 "2024-04-26T06:05:12Z")

</div>

Hi @Joe

Thank you for sharing the main.log file. I checked the log but couldn’t see an entry for “[wpSearchAndReplace],” which should be present when performing the Pull action in Devkinsta. (This is how it should look as shown in the sample screenshot below)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/2X/7/72c4e768dc3f54a9cf18e2d47a8bf14e539aff0a.png)

There could be some config between Devkinsta and Docker Desktop that got out of sync. If you haven’t already, please close or quit both the DevKinsta and Docker apps completely. After that, relaunch DevKinsta and try the pull action again.

Another thing you could try is to delete all the Devkinsta containers in your Docker Desktop. Once you’ve done this, relaunch Devkinsta to re-generate those containers. Please note that deleting and recreating the containers should not result in the loss of your local site data, as it is stored in the Docker Volumes.

To avoid unnecessary back and forth, please also provide us the following information.

**Machine OS version:**  
**Devkinsta version:**  
**Docker Desktop version:**

We look forward to hearing back from you. 🙂

---

<div class="post-metadata">

### Author: ![Joe](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/joe/32/3266_2.png) [@Joe](https://community.kinsta.com/u/Joe)
#### Post date: [April 26, 2024, 9:33am UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/7 "2024-04-26T09:33:29Z")

</div>

Hi,

Thanks for the reply! I initially tried both of your suggestions but to no avail. However, after deleting the site from DevKinsta, and pulling it down from scratch, it appears to now be working.

The only issue I have now run into is deleting the old site, as that appears to be stuck due to an issue removing SSL cert:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/2X/3/3d9576364247117303226b0108c463377d1d2036.png)

Any suggestions?

**Machine OS version:** 14.4.1 (23E224)  
**Devkinsta version:** Version 2.13.2 (2.13.2.8698)  
**Docker Desktop version:** Docker Desktop 4.29.0 (145265)

Thanks

---

<div class="post-metadata">

### Author: ![VladimirM](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/vladimirm/32/2786_2.png) [@VladimirM](https://community.kinsta.com/u/VladimirM)
#### Post date: [April 26, 2024, 11:56am UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/8 "2024-04-26T11:56:30Z")

</div>

Hello Joe,

I see that the screenshot states that SSL update failed. Can you try toggling HTTPS off (the one in your screenshot) and retrying to delete?

Kind regards

---

<div class="post-metadata">

### Author: ![Joe](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/joe/32/3266_2.png) [@Joe](https://community.kinsta.com/u/Joe)
#### Post date: [April 26, 2024, 1:06pm UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/9 "2024-04-26T13:06:11Z")

</div>

Hi,

Yes, I previously tried to turn off the SSL cert, as the site wasn’t working with it, however, it got stuck and has since always displayed that message. I can’t change the toggle at all, and as stated, the site won’t delete due to it either.

Joe

---

<div class="post-metadata">

### Author: ![Andrew](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/andrew/32/2792_2.png) [@Andrew](https://community.kinsta.com/u/Andrew)
#### Post date: [April 26, 2024, 5:16pm UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/10 "2024-04-26T17:16:07Z")

</div>

Hi @Joe!

Thank you for your reply! Would it be possible to direct/private message me the latest main.log file from DevKinsta after you attempt to delete this old site? That information will help us in identifying at what step the issue is occurring, and provide more insight into the root cause of the issue.

Best regards

---

<div class="post-metadata">

### Author: ![Joe](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/joe/32/3266_2.png) [@Joe](https://community.kinsta.com/u/Joe)
#### Post date: [April 29, 2024, 9:13am UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/11 "2024-04-29T09:13:34Z")

</div>

Hi Andrew,

I was able to finally delete the site after manually deleting the SSL certificate from MacOS Keychain Access, I don’t know why, but the kinsta main logs were saying: SecTrustSettingsRemoveTrustSettings: The specified item could not be found in the keychain.

However, once I manually deleted the certificate, I was able to delete the site from DevKinsta too.

---

<div class="post-metadata">

### Author: ![Joe](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/joe/32/3266_2.png) [@Joe](https://community.kinsta.com/u/Joe)
#### Post date: [April 29, 2024, 10:11am UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/12 "2024-04-29T10:11:29Z")

</div>

Sorry to open this back up, but…

I just opened another ticket relating to files/folders being deleted when importing a site - however, now that I’ve gone to use the site once again after running an import, only to find all the URLs are pointing back to the kinsta hosted site again 🤦‍♂️

I checked the logs, and can’t find any reference to the wpSearchAndReplace running, so it looks like that has once again stopped working.

I of course quit out DevKinsta and Docker, before relaunching them, but unfortunately, the issue prevails. I really can’t be deleting the site and containers each and every time I need to import from the hosted site, and I certainly can’t expect the rest of the development team to do the same each time either.

Please help.

---

<div class="post-metadata">

### Author: ![VladimirM](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/vladimirm/32/2786_2.png) [@VladimirM](https://community.kinsta.com/u/VladimirM)
#### Post date: [April 29, 2024, 1:46pm UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/13 "2024-04-29T13:46:17Z")

</div>

Hello Joe,

What kind of import are you running, are you importing/pulling from Kinsta or are you importing the database sql file/backup?

Kind regards

---

<div class="post-metadata">

### Author: ![Joe](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/joe/32/3266_2.png) [@Joe](https://community.kinsta.com/u/Joe)
#### Post date: [April 30, 2024, 7:21am UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/14 "2024-04-30T07:21:59Z")

</div>

Hi Vladimir,

All of the imports/pulls are done via DevKinsta. I am pulling the database, along with either all files, or just media uploads.

In any case, the search and replace does not run, and I have to manually run it myself via WP-CLI

Joe

---

<div class="post-metadata">

### Author: ![VladimirM](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/vladimirm/32/2786_2.png) [@VladimirM](https://community.kinsta.com/u/VladimirM)
#### Post date: [April 30, 2024, 9:43am UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/15 "2024-04-30T09:43:33Z")

</div>

Hi Joe,

I tested a couple of scenarios on my end and I don’t have that issue. I did try full and partial pulls from Kinsta to see if database URL will remain as on live, but they don’t, so something must be blocking the search-replace process.

Apologies for the back and forth, but since there’s no other way, could you please provide me with main.log file again to check if there’s something else that might help us figure out what is causing this?

Kind regards

---

<div class="post-metadata">

### Author: ![VladimirM](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/vladimirm/32/2786_2.png) [@VladimirM](https://community.kinsta.com/u/VladimirM)
#### Post date: [May 6, 2024, 8:10am UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/16 "2024-05-06T08:10:03Z")

</div>

Hello Joe,

Apologies for the delayed reply. The current log doesn’t have any entries that would be a clear indicator of what is going wrong with the process.

I do see an object cache-related error. Does this site use any plugin or code that acts as object cache? Do you see object-cache.php in wp-content of the site?

Kind regards,  
Vladimir

---

<div class="post-metadata">

### Author: ![dgilfillan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/dgilfillan/32/1122_2.png) [@dgilfillan](https://community.kinsta.com/u/dgilfillan)
#### Post date: [July 8, 2026, 8:16pm UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/17 "2026-07-08T20:16:02Z")

</div>

As of July 2026, I can confirm this is definitely still an issue.

I have troubleshot a Kinsta → DevKinsta import where the pull/import completed successfully and `main.log` showed that `[wpSearchAndReplace]` did run. However, source-environment URLs were still left in live database content afterwards.

The key issue appears to be that the DevKinsta pull/import replacement is too narrow.

In my case, the log showed a replacement like:

```plaintext
https://source-domain.example → http://local-site.local

```

That completed with exit code 0, so DevKinsta treated it as successful.

However, I found remaining source-domain references in `wp_postmeta`, specifically inside JSON-style stored data where URLs were escaped, for example:

```plaintext
https:\/\/source-domain.example\/wp-content\/uploads\/...

```

A plain replacement for:

```plaintext
https://source-domain.example

```

does not match that raw stored value, because the database value contains escaped slashes.

I confirmed this with SQL on an affected post:

```sql
SELECT
  LOCATE('https://source-domain.example', meta_value) AS plain_url_match,
  LOCATE('https:\\\\/\\\\/source-domain.example', meta_value) AS escaped_url_match,
  LOCATE('source-domain.example', meta_value) AS bare_domain_match
FROM wp_postmeta
WHERE post_id = <affected_post_id>
AND meta_key = '<affected_meta_key>';

```

In my case, `plain_url_match` was `0`, but `escaped_url_match` and `bare_domain_match` both returned matches.

The affected data I found was in Elementor-related meta keys such as:

```plaintext
_elementor_data
_elementor_element_cache

```

But I do not think this is only an Elementor issue. Elementor just makes it easy to see. The broader issue is that any plugin/theme data stored as JSON, escaped strings, encoded content, or serialized data may be missed if DevKinsta only replaces the plain protocol + domain URL.

For comparison, I checked a DevKinsta push back to a Kinsta environment. In that direction, the log showed broader replacements, including:

```plaintext
http://local-site.local → http://destination-domain.example
https://local-site.local → https://destination-domain.example
local-site.local → destination-domain.example

```

That final bare-domain replacement is important because it catches the domain even inside escaped values such as:

```plaintext
https:\/\/local-site.local\/...

```

So the issue appears to be specific to the DevKinsta pull/import workflow using a narrower replacement than the push workflow.

In the meantime, the workaround after importing into DevKinsta is to run an additional bare-domain search-replace.

Dry run first:

```bash
docker exec -it devkinsta_fpm sh -lc 'cd /www/kinsta/public/local-site-folder && wp --allow-root --skip-plugins --skip-themes search-replace "source-domain.example" "local-site.local" --all-tables --precise --recurse-objects --dry-run'

```

If that looks correct, run it for real:

```bash
docker exec -it devkinsta_fpm sh -lc 'cd /www/kinsta/public/local-site-folder && wp --allow-root --skip-plugins --skip-themes search-replace "source-domain.example" "local-site.local" --all-tables --precise --recurse-objects'

```

Then verify:

```bash
docker exec -it devkinsta_fpm sh -lc 'cd /www/kinsta/public/local-site-folder && wp --allow-root --skip-plugins --skip-themes db search "source-domain.example" --all-tables'

```

Possible fix: DevKinsta pull/import should run a broader replacement strategy similar to push, including a bare-domain replacement in addition to the protocol-specific URL replacement.

---

<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: [July 9, 2026, 3:46am UTC](https://community.kinsta.com/t/pulling-from-kinsta-search-and-replace-doesnt-work/3345/18 "2026-07-09T03:46:21Z")

</div>

Hi @dgilfillan

Unfortunately, the search and replace feature included with the Push/Pull action in Devkinsta does not support regex syntax to capture certain entries, such as `https:\/\/domain.com`. This means the output you’re seeing is indeed anticipated, and I sincerely apologize for any inconvenience this maybe causing.

This limitation mainly affects sites using Elementor, which employs its own unique syntax. That’s why Elementor offers a dedicated Search and Replace option within its plugin settings to address these specific needs.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/2X/f/f059b91a6745b30864667e4be92dc4c4d51e33d2.png)

Additionally, Elementor provides a WP CLI command for search and replace tasks, which you may find helpful. You can learn more about this feature here: [Elementor CLI - Replace URLs](https://developers.elementor.com/docs/cli/replace-urls/).

As such, when performing a Pull/Push through DevKinsta on sites that use Elementor, an additional Search and Replace action is needed to ensure no leftover entries from the source domain remain on the destination site.

Please know that your feedback is valuable to us, and we have submitted it as a feature request. We are hopeful that our search and replace functionality will be improved to help resolve this specific issue with Elementor in the future. While I can’t provide a timeline for when this might happen, I truly appreciate your patience as we work toward better solutions.

Thank you for your understanding!
