Importing an .gz database file

  • Unknown's avatar

    Hi,

    I had an old WordPress.com blog that I deleted but backed up entirely, and now I want to restore it.

    I’m not interested in the theme / plug-ins / media uploads, only the content (posts). So, among all the back up files I had exported through WordPress before deleting my website, I picked the one that says “db” (database). The text inside the file contains all my posts.

    Problem is, it’s a .gz file, which WordPress won’t accept.

    I don’t know why WordPress won’t import an export file that I generated on WordPress. I tried converting the file to xml or zip, the supported formats, to no avail. Can anyone please help?

    (BTW, the reason for the deletion was migrating my blog to GitHub. Since then, I’ve decided that I prefer WordPress. The GitHub website is still running, but from what I understand, it’s impossible to export it and migrate to WordPress, so I must use my old backup.)

  • Unknown's avatar

    Hi @omerkesem, the db file isn’t a content export, even though it came from WordPress.com. It’s part of a site backup and contains SQL, the regular importer needs an XML file from Tools > Export, so changing the filename or putting it in a ZIP won’t work.

    If you deleted the site less than 30 days ago, try restoring it. Once it’s back, go to Tools > Export, choose Posts, and use the downloaded XML file on your new site.

    If it was deleted more than 30 days ago, check the other backup files in case there’s an XML export among them. If not, you’ll need to open the database backup in a local WordPress site first. WordPress Studio can import a full .tar.gz or .zip backup. For a .sql.gz file, extract it to .sql before importing it. You can then export the posts from Studio as XML.

  • Unknown's avatar

    Thank you for your reply!

    I don’t have an XML backup, so I tried importing the .gz file into WordPress Studio, but got this error message:

    For the record, here’s the backup files I have:

    The rest are more “uploads” files.

    When I open the .gz file on my computer, I get a very long text document containing all my posts, so I’m sure it’s the right file. I don’t know why it doesn’t work.

  • Hi there!

    We reached out to you through email. I will close this thread so that we can continue the conversation there.

    Thank you!

  • The topic ‘Importing an .gz database file’ is closed to new replies.