How can I get blog content from SFTP?

by Morgan Smith   Last Updated October 19, 2019 20:08 PM - source

I inherited a site that was compromised (I'm not sure what version of wordpress, the crash happened last summer). I have CLI access, and can SFTP into the server. The only thing I want to get is the content of the blogs. I was able to see the mysql files from SFTP, but they are just the .frm files. What is the best way to get this content?

Answers 2

All of WP's blog content is in the database that is used by the blog. The database name is found in the wp-config.php file.

You could do a fresh WP install in a new folder (or new host or new local WP instance), then change the wp-config.php file for the old database : database name, user, password. That won't copy over all of your themes/plugins, although any theme/plugin data stored in the wp-config table will be there if you install/activate the theme.

All of the posts are in the wp-posts table (as well as pages and media), but it's a bit complex to extract posts from the wp-posts table.

If you want to see the site's posts/pages, then the above procedure will get you started.

Rick Hellewell
Rick Hellewell
October 20, 2019 02:53 AM

What I ended up doing since I had Mysql/SFTP access, was:

  1. create a dump using these instructions: here
  2. get the .sql file using cyberduck(newest version of mac conflicts with filezilla)
  3. open a local mysql workbench
  4. Run the .sql file
  5. using a select, get the blog info I needed
Morgan Smith
Morgan Smith
October 23, 2019 17:13 PM

Related Questions

There is no link or button to my blog page

Updated August 01, 2018 08:08 AM

Need help to add few features to WP website

Updated February 21, 2018 10:08 AM

Downloadable content file structure

Updated September 21, 2017 13:08 PM

How to list files from specific directory

Updated October 31, 2017 10:08 AM