1

I have an SQL file of my WordPress site but I lost my project files. So if I import the sql into my DB then can I run the sql with new database file? Or is there any other way to back the previous data?

3
  • Are you sure you don't have a backup of the images of your websites somewhere else? Nov 7, 2018 at 6:14
  • Yes, I am sure. Nov 7, 2018 at 6:19
  • Okay, that I'm truly sorry for you. The only good thing is you will have your pages and posts back. Nov 7, 2018 at 6:23

1 Answer 1

1

The problem is that your images reside in /wp-content/uploads/ and without this folder, everything will be restored except images and some files you have previously uploaded to the Media Library. The plugin(s) and the theme you used could be installed (uploaded and activated) again.

To backup a WordPress websites you only need to backup the following:

  • /wp-content/plugins/ - to backup the plugin(s) you use
  • /wp-content/themes/ - you only need to backup your active theme, the theme you're using
  • /wp-content/uploads/ - Mostly for your images and other things you have uploaded to the Media Library
  • And of course your database

Without these folders, you get all your post and pages back, but since you have no files and/or folders of your website, you will have no images, no plugins and you will have to install your plugin(s) and theme again or use another one.

5
  • What about xml files? I have an XML file but some files are failed to import. Nov 7, 2018 at 6:32
  • XML file? the SQL database backup usually ends with .sql or with a .zip file which also has a .sql file. Could you post the content of the xml file, so I could take a look? Nov 7, 2018 at 6:35
  • Post it to a website like > pastebin.com and post the url Nov 7, 2018 at 6:36
  • Okay, now I understand you, this XML file is created with the WordPress exporter > /wp-admin/export.php the thing is, that you will also need a live website to import your images. The export module of WordPress gives you the option to import uploaded files, but the website you are importing from must be live and serving images properly in order for it to work. See documentation: en.support.wordpress.com/export Nov 7, 2018 at 6:44
  • @Md.AbuZaman You're welcome :) Nov 7, 2018 at 6:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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