DATABASE EMPTY after import, HELP!

I followed this process to import a wp site:
1-downloaded all the content from inside public_html using ftp.
2-exported sql database (290mb) through phpmyadmin.
3-zipped the sql file along with all the files in step1
4-dragged/dropped into Local, gave site same domain name, Apache, php 5.6.20, mysql 5.6 (also tried mysql 5.5 with same results)

-I get an error when I visit site or wp-admin: Your wp-config.php file has an empty database table prefix, which is not supported.
-Adminer and SequelPro show zero tables, tried to import the same sql (I exported in step2 above) using Adminer I get: Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 355707216 bytes) in /etc/scripts/local-adminer.php on line 92
-Checked wp-config.php and it does not contain any of my database info
-I do see my sql database unzipped and transferred inside app/public but not inside app/sql (just an empty db.sql there)

The live server specs are: mysql 5.6.36 utf8, php 5.6.31 SAPI cgi-cgi, apache 2.4.25, wordpress 4.7.5

Please advise :sob:
Thank you

Try using duplicator to make a zip file.
install it on the live wordpress site and make a backup.
Then you just need to drag and drop that zip into local and it should import.


Can’t use Duplicator or Backupbuddy on live site, they both give errors when doing a full backup due to server issues with GoDaddy, even though I increased memory, limits, upload values…etc.
I’m left with FTP then database-only backup through Duplicator or phpmyadmin-export.

So I managed to import the database using SequelPro through Local, then had to do a search/replace for all urls and (wp-content path due to iThemesSecurity plugin which changes the wp-content path). The method I used for search/replace was through sequelpro>Export as sqlDump>then opened the sqldump with a textEditor on the same macOSX: searched and replaced all urls to the .dev domain and all paths back to wp-content. Saved the sqldump>import back into sequelpro which replaced the original tables. So far so good I thought, I even clicked on Adminer and indeed the database was there this time with all corrected urls/paths. Added only the database prefix to wp-config.php. Moved all website content back to wp-content to reverse iThemesSecurity change.

-wp-admin opens up, login works, all plugins there which I activated, but no content on front website with message from the theme Headway saying “no content to display, add grids”…I activated another theme, pages do load but everything broken: menu, texts, shortcodes…etc

something is not linking/transferring correctly is my guess. Any ideas???

Hi @us_heart,

Sorry for the trouble importing!

Editing a raw SQL file that’s from WordPress like that will unfortunately cause issues due to the way the data is formatted.

The special formatting is PHP’s serialization. The clumps of data will look something like the following, a:1:{i:0;s:4:"test";}. If you notice, there is a length beside test so if you change test without changing the length of s:4, it will corrupt the string.

With that said, the best way to search and replace the data is to use WP-CLI’s search-replace command.

Here’s what I would do in this situation:

Create a new site

  1. Create a new site in Local with the desired environment
  2. Open Sequel Pro for the newly created site and remove ALL of the tables

Import Site Files/Database

  1. Import the SQL file into that site
  2. Note the database prefix. It’ll be something like wp_. If there are multiple, make sure you pick the right one.
  3. Navigate to the site’s app/public folder and change the table prefix in wp-config.php if necessary. The default is wp_
  4. Copy the files from wp-content that you downloaded into the Local site’s app/public/wp-content folder

To find and replace

  1. Right-click on the site in the sidebar and go to “Open Site SSH”
  2. Enter wp search-replace '//' '//' ( being your live domain and being your Local site domain)
  3. View the site and check for any errors

Please let me know how that works for you.