Is it possible to create a Wordpress backup by simply copying all its files somewhere else? Will everything then be the same if I copy them back?

(Background: I have a Wordpress site which was hacked, so first I want to try to build a new Wordpress site, but I need a backup of the current one in case anything goes bad)

  • 1
    There are two parts to a Wordpress site (similar for most websites): the content and the database. Yes, you can just copy all the files but you'll also need to do a database dump; your host will probably have a control panel you can log in to to do this. Alternatively, Google for Wordpress backup plugins as many of them can take care of this for you too. – Tim Malone May 10 '16 at 7:40
  • thanks, it seems enough info for me. So if you make it as answer i will accept. Simple, and exact to what i wana know (and even something more) – Luboš Suk May 10 '16 at 7:43
  • Answer added as requested :) Glad it helped you! – Tim Malone May 10 '16 at 7:48

This will be brief, because there's not much to elaborate on.

There are two parts to a Wordpress site (similar for most websites):

  • the content, and
  • the database.

Yes, you can just copy all the files but you'll also need to do a database dump. Your host will usually have a control panel you can log in to to do this (often providing a tool called phpMyAdmin which allows you to do a DB dump and a lot more).

Alternatively, there are many Wordpress backup plugins out there that will take care of all of this for you.

EDIT: Expansion to answer below to help others who come across this.

A note about using the inbuilt exporter

Although you can export your content using the inbuilt Export function in Wordpress, I generally don't recommend this for making a reliable backup of your site. Yes it will backup your post content, but you won't be able to quickly restore your entire site: in particular, your plugins, themes, settings, and specific Wordpress version you were running won't be there.

In most cases, it will take a lot more manual work to restore a site that you only have the exported content for, and it may not be possible to restore everything. This is why I always recommend taking a full backup of your Wordpress directory and the database.

What files do you need to copy in the Wordpress directory?

For a full backup, along with your database, you should copy your entire Wordpress directory - that includes all wp-* files in the root plus a few others (eg. xmlrpc.php), as well as all three wp-* folders: wp-admin, wp-includes and wp-content.

Alternatively you could just backup wp-config.php and wp-content and download the rest from the Wordpress website, but you'll need to be careful that you download the exact Wordpress version your database corresponds to (which will also be the version that you know your theme and plugins work on). Again, to make things simple at restore time, I usually recommend to just back everything up yourself.

| improve this answer | |

You will have to copy the contents of the uploads folder and use the export function to backup posts, categories, and so on. This will give you a full backup of your content, that you can upload somewhere else.

This will not copy options of your site: the theme layout, settings of plugins and so on. To do that you will have to access the database directly. Your hosting party will know how to do this.

There are plugins that will take care of this or even cloud services that will take everything out of your hands.

| improve this answer | |
  • 1
    One small addition to the first option: if your theme or a plugin generates custom taxonomies, they will be copied with the export function, but they will not show until they are declared by a theme/plugin on the new location. – cjbj May 10 '16 at 8:24

No two sites are the same, because no two servers are the same.

Yes, mysqldump your db, and copy all files will work for the data; but your site will not be able to be dropped anywhere without installing necessary apache or nginx mods.

Most folks have managed hosting that will do this for them, and based on your question its likely you will have sysop stuff done by your host.

| improve this answer | |
  • Maybe i wrote question unclearly, but my thought is to backup on server and optionaly restore from backup on same server... – Luboš Suk May 10 '16 at 9:04
  • then the question is not anything about wordpress, but how to back up and restore MYSQL or Server Files. – Nick May 16 '16 at 23:18

Yes. You can backup your whole wordpress site by copying root directory ( Wordpress folder). Also it is necessary to take database backup also. In future when you need to restore website data then replace this wordpress folder and replace database backup file. Very Easy. Thanks

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.