Local Community

Using ManageWP with Local (HowTo)

tldr; You can make ManageWP’s Sync Local tool work if you edit the wp-config.php file to include your database’s port number. And downloading backups from ManageWP import well into Local using Locals Import function.

A little background

We use ManageWP and multiple hosts. TBH, at this point not sure I can live without it.
We REALLY wanted to use Local and ManageWP together somehow. We even tried the new Livelink with no real luck.

While using the ManageWP - Local Sync (beta)-, it would authenticate but then errored out.
It was crashing when connecting to the database. Hmm
The error was connection actively refused. I see that often since I use docker and get the port wrong for the database.

So I went into the wp-config.php file.

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

Wait, no port number, hmmm, what if I do this?

define( 'DB_HOST', 'localhost:10004' ); // (use the correct port number of course)

Ok after putting the port number in BOOM !
ManageWP will sync back and forth !!
There are a couple of error messages but seems to be files that should not be synced anyway. The cool thing is, its a real sync using Diffs rather than ManageWPs clone.

OH, also if you have not discovered it yet. In ManageWP, you can download a backup of a WordPress site. That backup imports well into local by using local’s import function.

A couple of caveats;

  1. The sites I am syncing originated from ManageWP and were brought down and added to local with the backup method I just listed. I have not yet tried creating a site and pushing it to an existing ManageWP site.
  2. I am using Local version 5.6.3+ (Pro) on Windows 10.
  3. have not done a deep dive into all the sync abilities yet tose what works and does not. However, at this point, it would be a ManageWP issue not Local
2 Likes

Thanks! I’m still trying to get to know how to work this tool but I appreciate you letting me know that it’s possible. lol

@ChipBurris - So I’d previously had local sync working using the DB_HOST edit you’d mentioned here but it seems something has changed recently with Local Sync and it’s no longer working for me.

I get the following error when trying to sync:

We could not detect active Worker plugin v4.6.2+ on https://*******.local/. If you mistyped the URL, you may close this window and try again. You can activate the plugin now, and run the check again. If this check does not seem to be working correctly and the latest plugin version is already active, you can continue anyway.

If I try to continue anyway I get PHP Errors:

Fatal error: Uncaught Error: Cannot use object of type stdClass as array in C:\Users\*****\Local Sites\*****\app\public\wp-content\plugins\worker\src\MWP\EventListener\PublicRequest\CommandListener.php on line 189
( ! ) Error: Cannot use object of type stdClass as array in C:\Users\*****\Local Sites\*****\app\public\wp-content\plugins\worker\src\MWP\EventListener\PublicRequest\CommandListener.php on line 189

I’ve got a ticket open with ManageWP as well but was just wondering if you’d encountered anything similar?

I will check into this. Have not had to do this recently