Import an existing wordpress site into Localwp

I’m trying to import into Localwp an existing wordpress site of which I only have the general folder of all files and a sql database file.

I proceeded like this:

  1. I installed a test site in Localwp
  2. I opened the database file with an editor and replaced the domain with the new domain provided by Localwp.
  3. I opened the empty database with Adminer deleted the existing tables and imported the database of the site that I want to restore.
  4. I opened the site folder in Local site and replaced the contents of the Public folder with the site files I want to restore.

Later I tried to reach the site from Localwp but unfortunately it doesn’t work, Fatal error is returned in the browser.

What am I doing wrong?
Is there another procedure in Localwp to restore an existing site?

Unfortunately I have no way to access the old original site, so I can’t install plugins. I only have the general files folder and the database.

Thank you

Hi @WoodyP

If you have a wp-content and sql you can simply zip them up together and then drag and drop that compressed file into Local which will automatically spin up a new site with those files.

For a more manual workflow, your process would look like this:

You could attempt a more manual import. The steps would look something like this:

  • Unzip the file in a common location, like the desktop
  • Create a new, blank site in Local. Use whatever username/password you like since you’ll overwrite the DB with this site archive’s dump.
  • Copy the wp-content folder from the unzipped location to this newly created site’s location
  • Copy the correct SQL dump to the site root.
  • Within Local, open the site shell
  • Import the dump with wp db import
  • If that works, now Search and replace the domains. wp search-replace ’ ’ ‘http:mylocalsite.local’

thank you for answering.
In the first case, do I have to modify the database? ie replace the domain with the one provided by Localwp, or will the domain be replaced by Localwp?
Anyway I created a zip file with the wp-content folder and the original sql file. I dragged the zip file into Local and it actually created the site, unfortunately it doesn’t open and the browser returns fatal error. :frowning:

Thank you

Hi @WoodyP

What does the error look like? Can you send a screenshot?

We may need some more details to help further:

  • What is your OS?

  • What version of Local are you on?

  • Please attach a copy of your Local Logs

I attach screenshots and log files.
MacOsx 11.6 operating system
Local v.6.7.0

Thank you!

Hi @WoodyP

Based on the fatal error I think what you need is this:

Can you click Open Site Shell, run that command and try again?

I opened “Open Site Shell”
and ran the command “wp config shuffle-salts” which confirmed with “Success: Shuffled the salt keys.”
But the site in the browser always fatal error.

Hi @WoodyP

The fatal error specifically mentions envato-wordpress-toolkit-master. If you open the site shell again and run wp plugin deactivate envato-wordpress-toolkit-master can you see if that will work?

This jogged my memory as I don’t believe Envato Toolkit will work on Local either:

the command gave an error, but I deactivated the plugin manually by renaming it, immediately after other plugins, such as wp-bakery and slider revolution, were signaled by the fatal error.
By disabling them all, the site actually started up and I entered the backend!
But it’s all broken because the main plugins can’t be activated otherwise they create a fatal error, I’ve already tried.

Thanks for your precious help!
Local is awesome, he recreated the site without even having to change the domain in the database!

Now I’ll just have to figure out how to make these plugins work… :wink:

1 Like

I’m glad you were able to get in there @WoodyP! Happy Developing :slight_smile: :green_heart:

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