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