Local Community

Where is my database? backup.sql upon export does not exist inside the public folder instead there is a local.sql in the sql folder

Issue Summary

backup.sql upon export does not exist inside public folder.

Troubleshooting Questions

  • Does this happen for all sites in Local, or just one in particular? all

  • Are you able to create a new, plain WordPress site in Local and access it in a Browser?

Replication

Please watch this (at least the last few seconds): Local tutorial: Importing, cloning, and exporting sites - YouTube
Hello guys, I want to export my website from LOCAL, and find the backup.sql in the exported folder so I can export it to a host (on the Internet). Once exported by LOCAL to my computer hard drive, there is no backup.sql inside the Public folder as you saw in the video! Instead, there is a SQL Folder inside the app folder, and inside that there is a local.sql this is the only SQL file in the entire WordPress backup, so is this my SQL file that should be exported to my PHPadmin on the host? What is the best app to download to open this file to see the tables?! Thank you.

System Details

  • Which version of Local is being used? last

  • What Operating System (OS) and OS version is being used? Winows 10

    • For example: macOS Catalina or Windows 10 Professional
  • Attach the Local Log. See this Community Forum post for instructions on how to do so:

Security Reminder

You’re right that the file is called local.sql now – the name of the file is taken from the database name which in this case, the database’s name is just “local”. In earlier versions of Local, that file was just the name “backup.”

You can use the local.sql file when deploying the site to your remote environment.

Whatever raw text editor you use for development! You need a raw text editor like VS Code (as opposed to something like Microsoft Word) to edit this file because other editors might mess up the actual characters within the file.

Note too, that if you are importing this file on your remote infrastructure, you’ll need to make sure that the urls are updated as well. You can do that by searching and replacing the urls within the local.sql file, or using a tool like wpcli to help run the search and replace.

Thank you. But now that I opened the local.sql on VS code I see there are so many references to my C drive as an address as well as localhost, how can I change all of them? there are so many…and change them to what? really there is no easy way to upload this local.sql from your computer and change them automatically?! Simply there is no way for me to know how to change all of this info. Is there a tutorial somewhere?! Do people who run their WP on LOCAL really open their database and change all of these? I FOUND 209 REFERENCES TO LOCAHOST AND 1 TO C: DRIVE, so many localhosts and also a path to C drive! so I need to change 209 addresses for localhost?! is it the same story when you use xampp or wamp?! Thank you! Update: I realized I can open the database local.sql on notepad++ and use replace window, to replace for example: “localhost:10045” with my domain name on the server such as “HELLO.com”, is this correct? What about 1 instance of C:

INSERT INTO wp_options VALUES (180,‘astra_sites_recent_import_log_file’,‘C:\Users\USER\Local Sites\WPsiteName\app\public/wp-content/uploads/astra-sites/import-30-Nov-2021-07-31-35.txt’,‘no’);

should I change this too? as you see there is a reference to C: drive on my computer for Astra plugin, or this are just comments with on function??!
and after this I just use FileZilla to upload the WP files and then php my admin on the server to upload the database… Just want to make sure I got everything correctly, thank you so much.

Everything you’re describing sounds about right. WordPress doesn’t store site links as relative links, instead it stores the whole url. Because of this, whatever the Local site domain is, that domain will show up as many times as there are “things” (posts, attachments, etc) in the database.

If you host with WP Engine or Flywheel, then using Local Connect will automate all of those processes of uploading files and running a search and replace on the database.

When hosting at another host, you’ll need to do the steps you’re describing manually in order to deploy a site. This general process of uploading files, uploading the database, and running a search-and-replace will be roughly the same with any other offline development tool, unless they have some sort of functionality to automate that process.

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