# WP CLI based commands not reaching database

**URL:** <https://community.localwp.com/t/wp-cli-based-commands-not-reaching-database/46463>\
**Category:** Support\
**Created:** [January 14, 2025, 1:30pm UTC](https://community.localwp.com/t/wp-cli-based-commands-not-reaching-database/46463 "2025-01-14T13:30:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![acook](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@acook](https://community.localwp.com/u/acook)\
**Post date:** [January 14, 2025, 1:30pm UTC](https://community.localwp.com/t/wp-cli-based-commands-not-reaching-database/46463/1 "2025-01-14T13:30:21Z")

</div>

### What issue or error are you experiencing?

My organization is working on setting up a local instance of our multisite. Using archive-based importing did not work in local, so I proceeded with attempting manual installation.

I successfully imported a partial export of our database, but wp search and replace does not execute becuase the wp cli won’t connect to the database. Noteably it’s possibly to connect via MySQL shell, and some wp commands are successful, but the search and replace and similar commands do not.

See this command and output:

-snip-\cfi-local-min\app\public\>wp site list --url=cfi-local-min.local --path=C:\Users-snip-\cfi-local-min\app\public

Error: Site ‘cfi-local-min.local’ not found. Verify `--url=<url>` matches an existing site.

* * *

### What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

Import DB Manuall from .sql file. Attempt to execute wp search-replace from site shell

* * *

### System Details

- **Local Version:**

WP 6.7.1  
PHP 7.4.3  
MariaDB 10.4.32

- **Operating System (OS) and OS version:**

Win11

* * *

### Local Logs

Attach your Local Logs here ([Help Doc - Retrieving Local’s Log](https://localwp.com/help-docs/troubleshooting/retrieving-locals-log-file/))

[local-logs.zip](https://community.localwp.com/uploads/short-url/f9rTTekkAh9Kwt7bpc8GAunMKYd.zip) (59.4 KB)

* * *

_ **Security Reminder** _  
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [January 14, 2025, 1:58pm UTC](https://community.localwp.com/t/wp-cli-based-commands-not-reaching-database/46463/2 "2025-01-14T13:58:28Z")

</div>

Hi @acook - Have you been working with our multisite documentation here on your manual set up?

> **[Multisite with Local](https://localwp.com/help-docs/advanced/wordpress-multisite-with-local/)**
>
> Developing WordPress multisites can be hard. Here are some tips for working with WordPress multisites in Local.

---

<div class="post-metadata">

**Author:** ![acook](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@acook](https://community.localwp.com/u/acook)\
**Post date:** [February 10, 2025, 1:26pm UTC](https://community.localwp.com/t/wp-cli-based-commands-not-reaching-database/46463/3 "2025-02-10T13:26:03Z")

</div>

after running the sql commands the local instance becomes unresponsive

the main thing I’m not clear about is how we should write the domain for replacement, for example I used:

UPDATE wp\_blogs  
SET domain = REPLACE(domain, ‘[centerforinquiry.org](http://centerforinquiry.org)’, ‘cfi-local-min.local’)

but it’s not clear if i should have used ‘cfi-local-min’

---

<div class="post-metadata">

**Author:** ![nickc](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nickc/32/21209_2.png) [@nickc](https://community.localwp.com/u/nickc)\
**Post date:** [February 10, 2025, 1:45pm UTC](https://community.localwp.com/t/wp-cli-based-commands-not-reaching-database/46463/4 "2025-02-10T13:45:21Z")

</div>

You’ll need to use the new full domain including .local (`cfi-local-min.local`).

> after running the sql commands the local instance becomes unresponsive

Are you sure wp\_blogs is the only place these replacements need to happen? There may be other tables in a multisite where the address is used.
