Support » Localhost Installs » Can I restore a site from a copy-paste backup of the directories?

  • Hi, I have a server with several websites that runs Windows Server 2008 R2. It turned out it had several nasty viruses (which happened before I was the admin). I cleaned it, but the disk became corrupt and the sites don’t load anymore. I made a backup copy of the site directories on a USB drive and tried to copy the needed files from there, but it says something like “cannot copy, disk corrupt”.
    I want to move the sites to a new machine, but I don’t have a backup made with a special plugin, just a direct copy of the directories. Is it possible to restore them from that?
    Thank you in advance.

    P.S. I didn’t want to make a backup with BackUpWordPress or use something like Duplicator to move it to the new machine before I removed the viruses; I feared they may transfer to the new machine as well.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You still have substantial problems.

    If you have a copy of the files on a USB stick, then yes these would give you a set of the code for your plugins and theme, also images, however I have some reservations about how useful they will be:
    – you may not have a good copy as suggested by the “disk corrupt” message.
    – the virus may have invaded these files.
    The other WordPress files (except for plugins and themes) are of very little interest since they can be reloaded any time from wordpress.org

    A bigger problem is that most of a wordpress website is stored in the database and not the files. Without a copy of the database you will not have your pages or posts, nor menus etc. Is there any way that you could still get a copy of the database? The name of the database will be in your “wp-config.php” file in the root directory of your website files. Unfortunately it is possible that the virus has compromised the contents of the database.

    You have not clarified the natue of the virus(s) you found ? Are they Windows ones or webserver ones ?

    There are commercial oganisations such as wordfence that can assist you with restoring websites.

    Hi, thanks for the reply. I found the names of the databases in wp-config.php, but I don’t know where the actual files are. I also can’t login to my control panel to access phpMyadmin (error 500, again because of corrupt disk). Where are typically the database files for WordPress in Windows Server 2008 R2 located?
    One of the viruses was TrojanDownloader:HTML/Adodb.gen!A. There were more, but they are purged from antivirus’ history .

    You must log into phpMyAdmin to export the .sql file for the DB

    I suggest using a backup/restore plugin like Akeeba Backup as it does everything for you.

    If you have access to the command prompt, then you probably don’t need access to phpMyAdmin to access databases. Try typing mysqldump at the command prompt. If you see a description of available options, great! That means you can ovtain a dump of your database from the command line. If you see “command not foung”, then you must locate the MySQL executables on your system. While at the command prompt, type:

    cd \
    dir /s mysqldump.exe

    It may take a while, but you should get a result that contains the location of the file.

    You can then go to that directory and run mysqldump. The command format will be something like this:

    musqldump -u user -p dbname > db.sql

    Replace user with the DB userbane and dbname with the database bane. You’ll then be prompted to enter the password for the DB username. Adter entering the password, a file named db.sql should be created, and it will be a dump of your database.

    Thank you, it worked! I have the db.sql file. Now I guess I should follow this tutorial to restore it on the new server, right? Are there any other steps I should take?

    You will have to perform a search/replace to change the urls in the db.

    https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.