How can I import a site into Local by Flywheel

I am new to Local by Flywheel but I love what I see.

I have a site’s files and DB on my local HD. How can I get that set up (import, migrate or deploy - take your pick on which word to use) into Local by Flywheel?

Note - I’m not talk about moving from any other desktop dev environment. Like I said, I have the files in my computer.

Thanks.

Bud

Hi Bud,

The best way would be to turn it into a .zip and let Local do the work for you. The basic layout of the zip looks something like this:

  • database.sql (anything ending in .sql in the root of the .zip will be recognized)
  • /wp-content

All other files are optional but will still be imported.

If you’re zipping it on a Mac you’ll want to make sure you select the files individually rather than selecting a single folder to zip.

Once you have the zip created you can drag and drop it onto Local (1.4.1 or newer) to import it.

if you need any more info please let me know.

Clay

That makes sense and I’ll have to try it out.

What I don’t understand is that “other files are optional.”

Don’t I have to include the entire WP set of files and the DB in the zip file?

Bud

The only files that are absolutely required is an SQL file containing the database and the /wp-content folder.

If wp-includes, wp-admin, etc. are missing then Local will automatically pull the latest version of WordPress, set up wp-config.php and then import the SQL file you provide.

Thanks Clay.

I got my zip file (database.sql and wp-content) in Local.

I used Add New Site from Archive. The application begins to process with “Importing Site. Analyzing Archive.” It runs for 5 sec and then returns to Select A Site.

Any ideas of what is going on? I’m on El Capitan and using the built in zip app.

Thanks.

Bud

I’ve been trying to do this too. I’ve got the zip file from my live site (cgi-bin.zip) and drop it on Local but it gives me this error…
“Sorry, we couldn’t figure out what to do with the import file provided.”

Thanks,
Jere

Hello Jere,

Sorry for the trouble!

What does the structure of the .zip file look like?

1 Like

it contains 4 folders, cgi-bin, wp-admin, wp-content, and wp-includes. plus a bunch of .php files. Is that what you mean by structure?

Yup!

Do you also have an .sql file in the root of the .zip?

Hmm, I don’t see one. Do I need to pull that off the live site different then zipping all the folder content? I hope that makes sense.

Yup!

The structure of your .zip should looking something like this:

  • wp-content/
  • database.sql

The other WordPress directories and files such as wp-includes, wp-admin, wp-config.php, etc. can be left out. They’ll be re-added upon import. Only keep them if you do not want to use the latest version of WordPress.

Also, feel free to include other files and directories such as robots.txt.

1 Like

Woo Hoo! I did it. Sorry but I’m kinda new at this. I realized that, like you said, I was just trying to load the files but there was no sql database. I went into phpMyAdmin of the site I was trying to create locally and exported the database, took that and the wp-content files (I included everything), zipped them together, dropped that zip file on Local By Flywheel and it worked!

There’s a few things messed up on the import but 90% is right. Mostly it’s missing some of the featured pictures and I have a slider at the top of the page with 3 rotating pictures and they don’t show up. I’m hoping I can go into the dashboard and pull that stuff in.

Thanks again for your help. I’m sure I’ll have more questions as I go.
~Jere

1 Like

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!

2 Likes

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.

1 Like

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?

@abclar,

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:

  1. Right-click on the site in Local
  2. Go to ‘Open Site SSH’
  3. Enter wp search-replace '//olddomain.com' '//newdomain.com'
  4. Done!
2 Likes

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

4 Likes

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.