Corrupt zip files when exporting via PHPMyAdmin (1 post)

  1. Zoee
    Posted 3 years ago #

    Hi all, I thought I'd share a solution I found to a problem - just in case anyone has the same issue!

    I was attempting to move a WordPress site from one host to another by copying across the files and database. When trying to export the database I found I couldn't import it to the new hosting account. I then realised the zip file was corrupt.

    I eventually found out it was in fact only the wp_postmeta and wp_post tables that were causing the issue, so I imported everything but these in the usual way.

    I tried many many different recommended ways to export/import these problem tables with no luck, then I tried the following and it worked a treat!

    - In PHPMyAdmin create a new table:
    CREATE TABLE new_table LIKE wp_posts;
    - copy the contents of your problem table in to the new one:
    INSERT new_table SELECT * FROM wp_posts;
    - Do this for each problem table
    - Export the new tables
    - Import the new tables in to the new hosting account
    - Create the tables wp_posts and wp_postmeta (+ any others missing)
    CREATE TABLE wp_posts LIKE new_table;
    - Copy the contents across using the following code again:
    INSERT wp_posts SELECT * FROM new_table;
    - Do this for both tables and there you have it!

    I hope this helps anyone else having issues exporting any tables :)

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.