Pulling from Kinsta - search and replace doesn't work

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

Hello Joe :wave:

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?

Kind regards

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.

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)

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

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:

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

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

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

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

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.

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 :man_facepalming:

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.

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

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

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

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

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:

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:

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

A plain replacement for:

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:

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:

_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:

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:

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:

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:

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:

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.

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.

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.

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!