# Uh-oh! Unable to import siite

**URL:** <https://community.localwp.com/t/uh-oh-unable-to-import-siite/28865>\
**Category:** Support\
**Tags:** site-import\
**Created:** [November 16, 2021, 6:38pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-siite/28865 "2021-11-16T18:38:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![startingtopuff](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@startingtopuff](https://community.localwp.com/u/startingtopuff)\
**Post date:** [November 16, 2021, 6:38pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-siite/28865/1 "2021-11-16T18:38:51Z")

</div>

### Issue Summary

I have just tried to create a local site using a backup from a web host but getting the above error. Details below:

```auto
Error: Command failed: /Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-7.3.5+11/bin/darwin/bin/php /Applications/Local.app/Contents/Resources/extraResources/bin/wp-cli/wp-cli.phar --path=/Users/alanshaw/Local Sites/bridgetscakes-co-uk-2021-11-16-05-48-55/app/public --require=/Applications/Local.app/Contents/Resources/extraResources/bin/wp-cli/local-wpcli-error-reporting.php --skip-plugins --skip-themes --url=staging.bridgetscakes.co.uk search-replace --all-tables-with-prefix http://staging.bridgetscakes.co.uk http://bridgetscakes-co-uk-2021-11-16-05-48-55.local
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

```

#### Troubleshooting Questions

- Does this happen for all sites in Local, or just one in particular?  
Just this one

- Are you able to create a new, plain WordPress site in Local and access it in a Browser?  
Yes

#### Replication

Describe the steps that others can take to replicate this issue. If you have screenshots that can help clarify what is happening, please include them!

#### System Details

- Which version of Local is being used?  
Version 6.1.5

- What Operating System (OS) and OS version is being used?  
Mac Big Sur OS 11.6.1

- Attach the Local Log. See this Community Forum post for instructions on how to do so:

### 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:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [November 17, 2021, 8:10pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-siite/28865/2 "2021-11-17T20:10:51Z")

</div>

That message about there being a critical error on the WordPress site usually means that there is some sort of PHP fatal error that is breaking WordPress and preventing Local from importing the site easily.

You might have to manually import the site by doing the following:

1. Create a new site in Local.
2. Unzip the site backup to a temporary location, for example on your Desktop.
3. Replace the `wp-content` folder of the new Local site with the `wp-content` folder from the site backup.
4. Copy the database dump (the file ending in `.sql`) to the site root located at `sitename/app/public`
5. Within Local, right-click on the site and select “Open Site Shell.”
6. Using wpcli, import the database.
7. Using wpcli, update the domain within the database.

Those last two steps will look something like this within the terminal window that was opened:

```auto
wp db import database-dump.sql
wp search-replace '//example.com' '//example.local'

```

Can you give that a try and let us know how it goes?

---

<div class="post-metadata">

**Author:** ![startingtopuff](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@startingtopuff](https://community.localwp.com/u/startingtopuff)\
**Post date:** [November 19, 2021, 5:38pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-siite/28865/3 "2021-11-19T17:38:45Z")

</div>

Hi Ben,  
Thank you for your comprehensive reply. Let me say first of all this was way out of my area of expertise so I am surprised I got as far as I did. The first error was down to me using incorrect syntax (missing out ‘//’ but I ran the last command again but it still errored. I’m hoping it’s some thing simple.

```auto
You have new mail.
/Users/alanshaw/Library/Application\ Support/Local/ssh-entry/qF05Sw4V5.sh ; exit;
alanshaw@AlansRetinaiMac ~ % /Users/alanshaw/Library/Application\ Support/Local/ssh-entry/qF05Sw4V5.sh ; exit;
-n -e
Setting Local environment variables...
WP-CLI: WP-CLI 2.5.0
Composer: 2.1.5 2021-07-23
PHP: 7.3.5
MySQL: mysql Ver 8.0.16 for macos10.14 on x86_64 (MySQL Community Server - GPL)
Launching shell: /bin/zsh ...
alanshaw@AlansRetinaiMac public % wp db import bridgets_newsite1.sql
**Success:** Imported from 'bridgets_newsite1.sql'.
alanshaw@AlansRetinaiMac public % wp search-replace '//example.com' 'example.local'
**Error:** There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
alanshaw@AlansRetinaiMac public % wp search-replace '//example.com' '//example.local'
**Error:** There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
alanshaw@AlansRetinaiMac public %"
```

---

<div class="post-metadata">

**Author:** ![startingtopuff](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@startingtopuff](https://community.localwp.com/u/startingtopuff)\
**Post date:** [November 19, 2021, 5:46pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-siite/28865/4 "2021-11-19T17:46:41Z")

</div>

When I tried to launch site I got this, is it any help for troubleshooting?

 ![Screen Shot 2021-11-19 at 17.44.10](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/2X/3/3d629ad4d0127a9a74664094304fe106bfbdf3cf.jpeg)

---

<div class="post-metadata">

**Author:** ![afragen](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/afragen/32/31_2.png) [@afragen](https://community.localwp.com/u/afragen)\
**Post date:** [November 19, 2021, 5:47pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-siite/28865/5 "2021-11-19T17:47:52Z")

</div>

Seems like you have an issue with the mu-plugin, wp-stack-cache.php

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [November 19, 2021, 8:16pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-siite/28865/6 "2021-11-19T20:16:50Z")

</div>

Like what @afragen – the error is likely due to the `wp-stack-cache.php` plugin.

You can open a file browser and navigate to that folder:

```auto
~/Local Sites/examplecom/app/public/wp-content/mu-plugins

```

From there, temporarily move that file outside of the site (like your desktop). This should allow you to run those wpcli commands to import the db.

---

<div class="post-metadata">

**Author:** ![startingtopuff](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@startingtopuff](https://community.localwp.com/u/startingtopuff)\
**Post date:** [November 20, 2021, 7:04pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-siite/28865/7 "2021-11-20T19:04:04Z")

</div>

Hi,First of all thank you everyone for your advice. Went down a few blind alleys so decided to start afresh and as can be seen from below all appeared to work. The bad news is if I try and open site from within Local it goes straight to my externally hosted site. I confirmed this by disconnecting from network whereby local site would not load.

```auto
"alanshaw@AlansRetinaiMac public % wp db import StagingDev.sql
Success: Imported from 'StagingDev.sql'.
alanshaw@AlansRetinaiMac public % wp db import StagingDev.sql
Success: Imported from 'StagingDev.sql'.
alanshaw@AlansRetinaiMac public % wp search-replace '//BridgetsCakes.co.uk''//BridgetsCakes.local'
usage: wp search-replace <old> <new> [<table>...] [--dry-run] [--network] [--all-tables-with-prefix] [--all-tables] [--export[=<file>]] [--export_insert_size=<rows>] [--skip-tables=<tables>] [--skip-columns=<columns>] [--include-columns=<columns>] [--precise] [--recurse-objects] [--verbose] [--regex] [--regex-flags=<regex-flags>] [--regex-delimiter=<regex-delimiter>] [--regex-limit=<regex-limit>] [--format=<format>] [--report] [--report-changed-only] [--log[=<file>]] [--before_context=<num>] [--after_context=<num>]
alanshaw@AlansRetinaiMac public % "

```

 ![Screen Shot 2021-11-20 at 18.52.24](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/2X/0/0636ff865644989c9cae5bf850199304f0e2fb19.jpeg)  
 ![Screen Shot 2021-11-20 at 15.39.43](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/2X/b/b4bb357be899db37c54ae1793d444541b58f83d8.jpeg)

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [December 16, 2021, 7:51pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-siite/28865/8 "2021-12-16T19:51:43Z")

</div>

Hey @startingtopuff – Looking at that wpcli command, I think it might be missing a space between the domains.

I edited your reply to make the formatting a little easier to read, and here’s what I’m seeing:

 ![Image 2021-12-16 at 11.47.19 AM](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/2X/5/5a0e60d864ecbc6d83903863a153375712211ba2.jpeg)

I think you should be able to do a search and replace for this site using this command:

```auto
wp search-replace '//BridgetsCakes.co.uk' '//BridgetsCakes.local'

```

Give that a try and let us know how it goes!

---

<div class="post-metadata">

**Author:** ![startingtopuff](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@startingtopuff](https://community.localwp.com/u/startingtopuff)\
**Post date:** [December 17, 2021, 4:42pm UTC](https://community.localwp.com/t/uh-oh-unable-to-import-siite/28865/9 "2021-12-17T16:42:34Z")

</div>

Hi Ben, Thank you so much, it all appears to be OK now. the puzzling thing is when I ran the revised command it returned “Made 0 replacements”  
| wp\_users | user\_login | 0 | SQL |  
| wp\_users | user\_nicename | 0 | SQL |  
| wp\_users | user\_email | 0 | SQL |  
| wp\_users | user\_url | 0 | SQL |  
| wp\_users | user\_activation\_key | 0 | SQL |  
| wp\_users | display\_name | 0 | SQL |  
| wp\_yoast\_seo\_links | url | 0 | SQL |  
| wp\_yoast\_seo\_links | type | 0 | SQL |  
±-------------------±----------------------±-------------±-----+  
Success: Made 0 replacements.  
alanshaw@AlansRetinaiMac public %

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [December 19, 2021, 4:43am UTC](https://community.localwp.com/t/uh-oh-unable-to-import-siite/28865/10 "2021-12-19T04:43:08Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
