Clarification on SQL files created for local site

Hello, I am currently working on moving my local site to a subdomain. Part of the process is to import my local DB. I looked through the directory that was made by Local and saw inside the sql/ folder that there were two created: “(the name of my main site’s database)” and “local”.

For context I had downloaded a copy of my live site to work on locally, and this is what I am trying to upload to my subdomain.

I see that the main site DB was last modified on the day I created the local site, while this local.sql file was last modified today. Am I correct in assuming that local.sql is the database I should be importing for my subdomain?

Hey @ipanis!

Is your live site a multisite then? Working with multisites in Local generally requires a bit more manual work to set up. Here is our documentation:

Simply speaking however, if you exported a copy of your site from Local, when you open up that file the DB for your site will be under App > SQL > Local.sql

You could always place that into a text editor or other viewer of your choice in order to inspect it’s contents if you’re unsure of what is what.

My live site is not a multisite – it’s just one, and the subdomain will be to house tests/changes. So I have some work I’ve done locally that I’d like to upload to this subdomain so that other people can view it whenever (rather than use Live Links and have people depend on me putting the local site online).

I did take a look at both SQL files but they’re both huge so I wasn’t sure which one to import. Thank you for the clarification.

I did end up importing local.sql, though, after I created this thread and it threw a critical error on my website. I created a new database, created the connection by modifying my wp-config (starting up the site at this point prompted a new WP install), and then imported the SQL file (which is what threw the error). Will troubleshoot and look into it. If you have any ideas on what could be causing this I’d love to hear it.

A simple thing to check would be to make sure all of your configuration settings are the same. Does your Local site and Live site have the same WordPress, PHP, MySQL versions? Is the server type the same?

Hello, I ended up fixing it :slight_smile: I enabled error messages in wp-config and turns out one of my PHP files was getting corrupted when uploading it via FTP. Switched the transfer type from ASCII to binary and it was good to go. Thanks!

1 Like

Great work! Thank you for the follow up @ipanis :green_heart:

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