Is there a way to do this so that the files can be synced between two computers using something like dropbox?
Can confirm. This does work, and it works very well. Archive all files, back up database into single sql file in the root of WP, make a zip of the whole thing, Add Site -> Archive in Local. Flawless!
I’m trying to import from WP installation build on Mamp Pro. Finding the wp-content folder is easy… does anyone know where to find the .sql file on Mamp Pro?
You can export the database using PHPMyAdmin in MAMP Pro. You may have to click on the “WebStart” button to get to it.
Hi, This is my first post here, and I am new to the localhost environment. I also would like to import just the sql data from my live site into a newly-created Local dev site. I have exported the database from the live site using the phpMyAdmin facility in cPanel. I “selected all” and exported in a zip file to my desktop and then attempted to drag the zipped file into the Local window which only has one site in its index. Nothing happened! What am I doing wrong?
Database only imports aren’t supported at this time.
One thing you can do is create a new site in Local, then open up the database using Adminer or Sequel Pro (under the Database tab for that site) and import the SQL there.
Please note: you may need to run a search and replace on the database if the domain in the .sql file doesn’t match your Local dev domain. By that I mean you’re pulling from something like live-site.com and wanting to import it into local-site.dev.
Here’s how you can run the search and replace with WP-CLI in Local:
- Right-click on the site in Local
- Go to ‘Open Site SSH’
- Enter
wp search-replace '//olddomain.com' '//newdomain.com'
- Done!
OK, after MANY hours…I now have the steps for importing a live site into Local by Flywheel on a Mac.
(I did try all of the above but it didn’t all work for me exactly as it said.)
STEP 1:
Go to File manager in your cPanel and make a copy of the /wp-content folder to your local computer
STEP 2:
Go to php MyAdmin and find your database. Click on it then click on EXPORT, “Quick” method, then Format “SQL”. Click GO and save it to the same place you saved the wp-content folder on your computer.
STEP 3:
Now go to where you have saved these two items (wp-content foder & nameofyourdatabase.sql file), highlite them both, right click and compress them together. It will create an “ARCHIVE” zipped file in the same place.
STEP 4:
Go to the Local by Flywheel program and DRAG the ARCHIVE Zip file anywhere into the app box. It will automatically start unzipping and installing. It will save it as “archive.dev” unless you call it something else.
Remember that because this was a backup that you installed, you will need to login with the credentials you normally use away from Local by Flywheel (like when you login into wp-admin). It will not use your Local by Flywheel default username and passsword. After you login you can then go into USERS and add the default Local one and delete the “usual” one.
Hope this helped! Ana
Hi Ana,
Thank you for this step by step guide !
But there is still something I do not understand: I have imported and old version (local backup) of a website. Importing wp-content and SQL works fine, but when I try to view my site locally, I am forwarded to the domain name of the website.
I have tried to import the site and giving it a completely different name, but still, I am being forwarded to www.darkantzaro.com everytime.
Can you please help?
Many thanks and best regards,
Fouad.
Is it supposed to take forever? I have let it go for about an hour or so and it is still adding(moving files). I have my zip structured the way it says but I am using the full site instead of just the content. The site is only 160MB though. Why would it be taking so long? There were no errors when checking the archive
Hi,
I’m able to import a site from a .zip file but it doesnt works. Admin and View site buttons shows me “Internal Server Error”.
Can you help me?
Hi Guilherme,
Please go to the wp-config.php in app/public
and add define('WP_DEBUG', true);
above That's all, stop editing! Happy blogging.
If you see another WP_DEBUG
set to false
you can simply change it to true
This should provide some more info than an internal server error.
For more info you can also browse to the logs
folder in the site folder and look in the PHP error logs.
Hi Clay,
I found this in Apache error log:
[Fri Jun 02 18:54:18.148746 2017] [mpm_event:notice] [pid 364:tid 140434530805632] AH00489: Apache/2.4.10 (Debian) configured – resuming normal operations
[Fri Jun 02 18:54:18.403042 2017] [core:notice] [pid 364:tid 140434530805632] AH00094: Command line: ‘/usr/sbin/apache2’
[Fri Jun 02 18:55:33.825607 2017] [core:alert] [pid 367:tid 140434440595200] [client 172.17.0.1:45510] /app/public/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration
[Fri Jun 02 18:55:34.095303 2017] [core:alert] [pid 367:tid 140434357614336] [client 172.17.0.1:45514] /app/public/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration, referer: http://dominewp.dev/
[Fri Jun 02 18:55:46.237670 2017] [core:alert] [pid 367:tid 140434349221632] [client 172.17.0.1:45518] /app/public/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration
[Fri Jun 02 18:56:05.724197 2017] [core:alert] [pid 367:tid 140434340828928] [client 172.17.0.1:45522] /app/public/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration
[Fri Jun 02 19:11:33.408140 2017] [core:alert] [pid 367:tid 140434332436224] [client 172.17.0.1:45526] /app/public/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration
[Fri Jun 02 19:12:13.060022 2017] [core:alert] [pid 367:tid 140434324043520] [client 172.17.0.1:45530] /app/public/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration
[Fri Jun 02 19:12:13.702775 2017] [core:alert] [pid 367:tid 140434315650816] [client 172.17.0.1:45534] /app/public/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration, referer: http://dominewp.dev/
[Fri Jun 02 19:23:48.973369 2017] [core:alert] [pid 367:tid 140434307258112] [client 172.17.0.1:45638] /app/public/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration
[Fri Jun 02 19:24:21.443704 2017] [mpm_event:notice] [pid 494:tid 139717428799360] AH00489: Apache/2.4.10 (Debian) configured – resuming normal operations
[Fri Jun 02 19:24:21.443883 2017] [core:notice] [pid 494:tid 139717428799360] AH00094: Command line: ‘/usr/sbin/apache2’
[Fri Jun 02 19:25:30.037459 2017] [core:alert] [pid 498:tid 139717338588928] [client 172.17.0.1:45642] /app/public/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration
[Fri Jun 02 19:28:36.197847 2017] [core:alert] [pid 498:tid 139717330196224] [client 172.17.0.1:45646] /app/public/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration
Aha! Good find
If you browse to app/public
and then open up .htaccess
and remove or comment out the php_value
lines you should be set.
.htaccess
is hidden so you’ll need to open it with an editor that allows you to see hidden files like Atom or Sublime Text (or whatever you prefer).
It shows me this:
( ! ) Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
( ! ) Fatal error: Unknown: Failed opening required ‘/home/domiqtvw/public_html/wordfence-waf.php’ (include_path=’.:’) in Unknown on line 0
There’s probably a block of code in .htaccess surrounded by # Wordfence WAF
. I would remove everything in that block.
Wordfence should automatically re-add it and correct for the new environment if necessary.
Doesnt works, it searchs for wordfence-waf.php.
I’m trying to change path in htaccess:
# Wordfence WAF
<IfModule mod_php7.c>
php_value auto_prepend_file '/home/dominewp/app/public/wordfence-waf.php'
</IfModule>
<Files ".user.ini">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</Files>
# END Wordfence WAF
Can you change the above to the following?
php_value auto_prepend_file '/app/public/wordfence-waf.php'
Internal Server Error.
php error log:
[02-Jun-2017 19:33:41 UTC] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[02-Jun-2017 19:33:41 UTC] PHP Fatal error: Unknown: Failed opening required '/home/domiqtvw/public_html/wordfence-waf.php' (include_path='.:') in Unknown on line 0
[02-Jun-2017 19:34:42 UTC] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[02-Jun-2017 19:34:42 UTC] PHP Fatal error: Unknown: Failed opening required '/home/domiqtvw/public_html/wordfence-waf.php' (include_path='.:') in Unknown on line 0
[02-Jun-2017 19:36:39 UTC] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[02-Jun-2017 19:36:39 UTC] PHP Fatal error: Unknown: Failed opening required '/home/domiqtvw/public_html/wordfence-waf.php' (include_path='.:') in Unknown on line 0
[02-Jun-2017 19:36:56 UTC] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[02-Jun-2017 19:36:56 UTC] PHP Fatal error: Unknown: Failed opening required '/home/domiqtvw/public_html/wordfence-waf.php' (include_path='.:') in Unknown on line 0
[02-Jun-2017 19:37:21 UTC] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[02-Jun-2017 19:37:21 UTC] PHP Fatal error: Unknown: Failed opening required '/home/domiqtvw/public_html/wordfence-waf.php' (include_path='.:') in Unknown on line 0
[02-Jun-2017 19:37:22 UTC] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[02-Jun-2017 19:37:22 UTC] PHP Fatal error: Unknown: Failed opening required '/home/domiqtvw/public_html/wordfence-waf.php' (include_path='.:') in Unknown on line 0
[02-Jun-2017 19:37:26 UTC] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[02-Jun-2017 19:37:26 UTC] PHP Fatal error: Unknown: Failed opening required '/home/domiqtvw/public_html/wordfence-waf.php' (include_path='.:') in Unknown on line 0
[02-Jun-2017 19:38:36 UTC] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[02-Jun-2017 19:38:36 UTC] PHP Fatal error: Unknown: Failed opening required '/home/domiqtvw/public_html/wordfence-waf.php' (include_path='.:') in Unknown on line 0
[02-Jun-2017 19:45:29 UTC] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[02-Jun-2017 19:45:29 UTC] PHP Fatal error: Unknown: Failed opening required '/home/domiqtvw/public_html/wordfence-waf.php' (include_path='.:') in Unknown on line 0
[02-Jun-2017 19:45:31 UTC] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
[02-Jun-2017 19:45:31 UTC] PHP Fatal error: Unknown: Failed opening required '/home/domiqtvw/public_html/wordfence-waf.php' (include_path='.:') in Unknown on line 0
Oh my gosh! This worked perfectly. I packaged up my live site using Duplicator and then literally dragged the .zip file into the Local window. I had to change the entry in the SQL file for “home,” but that was easy.
@jdolan - do you mind sharing what version of Local you are using? I’m trying to do this with 2.03 and having issues… but, it’s probably me.
Can you also maybe explain how to change the entry in the SQL file for ‘home’… when I look in my .sql file, I see the first instance of ‘home’ has the URL of my live site… I’m guessing that’s wrong. Is this where you change it ‘easily’?
I saw Clay’s instruction to use WP-CLI by right-clicking on the site in Local to open site SSH… but I got an error message that the container is not running… which I guess isn’t surprising since that is the step my import seemed to hang up on.
thanks for your time!