Duplicate existing Local site into another Local instance

This is similar to an existing support request where I’m receiving an error that says Please try again with a compatible ZIP file.


What steps can be taken to replicate the issue?

  1. Local app on MacOS - right-click on site, Export, then click “Export site” button
  2. Transfer zip file from Mac to Windows
  3. Ctrl-I (Import) from Local app on Windows
  4. Choose exported zip file from above
  5. Confirm settings and click Import button

I’ve tried this probably 5 times, same result where I receive the error message stated above about a compatible ZIP file.

I’ve tried a more manual approach as well, as @Nick-B usually suggests.

  1. Created a new, blank site in Local
  2. Copied wp-content into existing directory
  3. Copied the SQL file into site root
  4. Opened the site shell
  5. Ran wp db import filename.sql

The error I continually get here says Error: Failed to get current SQL modes. Reason: ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

Remaining questions:

  1. Why isn’t it straightforward to migrate a site to another Local instance using export and import?
  2. Does exported file size matter? My zip file is about 9GB.
  3. On Windows, is there another server name I need to use for using MySQL to import the SQL database?

It’s really disappointing this process isn’t working after multiple attempts and methods.


System Details

  • Original Local Version: 7.1.0+6396

  • Destination Local Version: 7.1.2+6410

  • Original Operating System (OS) and OS version: MacOS 13.4

  • Destination Operating System (OS) and OS version: Windows 10 22H2


Local Logs

{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-08-15T18:55:53.339145Z 0 [System] [MY-010116] [Server] %%resourcesPath%%\\lightning-services\\mysql-8.0.16+6\\bin\\win64\\bin\\mysqld.exe (mysqld 8.0.16) starting as process 13996","timestamp":"2023-08-15T18:55:57.884Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-08-15T18:55:53.437918Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","timestamp":"2023-08-15T18:55:57.885Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-08-15T18:55:56.099155Z 0 [System] [MY-010229] [Server] Starting crash recovery...","timestamp":"2023-08-15T18:55:57.889Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-08-15T18:55:56.113122Z 0 [System] [MY-010232] [Server] Crash recovery finished.","timestamp":"2023-08-15T18:55:57.890Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-08-15T18:55:57.714590Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","timestamp":"2023-08-15T18:55:57.892Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-08-15T18:55:57.886593Z 0 [System] [MY-010931] [Server] %%resourcesPath%%\\lightning-services\\mysql-8.0.16+6\\bin\\win64\\bin\\mysqld.exe: ready for connections. Version: '8.0.16'  socket: ''  port: 10004  MySQL Community Server - GPL.","timestamp":"2023-08-15T18:55:57.894Z"}
{"stack":"Error: EPERM: operation not permitted, symlink '..\\acorn\\bin\\acorn' -> 'C:\\Users\\info\\AppData\\Local\\Temp\\local-by-flywheel-bqaQeVSRV5\\app\\public\\node_modules\\.bin\\acorn'","level":"warn","message":"Unable to import site.","timestamp":"2023-08-15T20:28:36.532Z"}
{"thread":"main","class":"DeleteSiteService","level":"warn","message":"Could not trash","timestamp":"2023-08-15T20:28:43.607Z"}

Hi @firefox

Thank you for all of your details and troubleshooting! We definitely want this process to be as seamless as possible and we are looking at any enhancements that could be made to help make it even smoother.

Something that could be happening in your use case is a clash between the different OSes as I don’t think I’ve seen anyone try to move from a Mac to Windows or vice versa, at least not lately and it’s not something I’ve tested myself.

The thread you linked, that user was able to get things working by using WP Migrate Lite to create an export file. I wonder if that might work in your case as well here.

WP Migrate Lite is a free plugin, and we also work with the creators over at Delicious Brains closely on functionality. With it, you should be able to create a full site export if you wish, and if that doesn’t work you could try creating a simple one that only includes the WP Content and SQL which are all Local needs to get things going.

Something else you can try, is when you export your site on the Mac if you try to import it back into Local on your Mac does it work? That might indicate something specifically on Windows is blocking it. A security application, another dev program, etc. In your log it shows Operation Not Permitted, so perhaps it’s this?

The size of the site shouldn’t matter, especially for manual imports, but you could also double-check that the hard drive on the new machine has enough space and isn’t corrupted as well to make sure it isn’t a hardware limitation.

Thanks for the feedback, Nick!

After you pointed out the logs mentioned Operation Not Permitted, I realized I probably knew the answer. Windows runs applications with less privileges by default. My suspicion is that this caused the error!

I then went to the Start Menu or start search bar, searched for Local, then right-click and “Run as administrator” to open the application with full privileges. Magically, the import process starts!

I wonder if others on this forum complaining about Windows version of Local are suffering from a similar problem?

Thanks for your attention!

1 Like

Glad to hear it @firefox! Thank you for coming by and confirming the solution so others can find it as well. Happy Developing :smile:

One follow up to the import working. Since my previous message, which is over an hour now, it appears Local is hanging on a message at the end that says “Starting Up Site Services” and the new local site still saying “Adding…”. I assume this isn’t the standard import process time?

It definitely shouldn’t take over an hour even for a larger site. What is your Router Mode set to? If you change it to Localhost are you able to try again and see if that works? There might still be a hung process or another program that is interfering.

I checked in Preferences > Advanced and see that it defaulted to “Site domains”.

Upon reading your reply just a few minutes ago, I went ahead and completely shut down Local and reopened it. It appeared that whatever it hung on didn’t seem to matter after opening Local up again.

When I started the site and went to see it in the browser, it’s now at the setup screen instead of the expected existing Local site that I imported. I see the local.sql file has the same file size as my exported site so it seems like it should be good in theory.

I then opened Adminer which showed no tables were imported into the database. Very strange.

So, one step forward is that it appears all my files were successfully imported. Two steps backwards where my DB didn’t import and the appearance of the site services not starting up, which just required an app restart.

Thoughts?

Now that you’ve rebooted it might be worth just wiping the install and trying a fresh import. I’d so something like

  • Delete the site
  • Restart Local
  • Enable Localhost mode
  • Re-import site

Thanks for the suggestion. I had a similar result, this time it just continuously looks like it’s importing the database. Seems strange that this doesn’t seem to be completing.

Following this, I went ahead and shut down Local, reopened it, and started the site to receive another error popup. Maybe this is a result of the import not completing.

That error kind of aligns with something else blocking Local or a hung process somewhere.

Are you running other developer applications simultaneously? Apps like MAMP, XAMPP, or Docker for example.

If you stop the sites, shut down Local, and run the command netstat -ano do you see any processes there that could be conflicting?

Interesting, I don’t have any other development environment running locally.

I ran netstat and see a bunch of localhost addresses with various ports. I’m not even sure which port Local needs to use to know what could be conflicting.

What you’ll be looking for here is to see when sites are stopped and Local is properly shut down if there are still programs running on ports 80 and 443. These may be conflicting with Local or the system may be reporting Local is still running.

Once you run that command you should see a list of listening ports. If you see a particular program making use of those ports, you can then kill that process by running sudo kill -9 XXX where XXX is the PID number of that process. (On Windows you will use taskkill /F /pid XXX where XXX is the PID number of that process)

There are also some more details around this and other troubleshooting steps at this link if needed: Stopping Whatever Is Listening On Port 80.

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