• Resolved mixmethods

    (@mixmethods)


    Hi all, I am helping with a hacked WordPress site. I was able to remove some malicious code and make the site reappear, rather than showing an error, but it still has many problems, and I also cannot get to the login page because there are many damaged php files.

    I was given some good advice to try replacing all of the core WordPress files. I have the whole site backed up, but I still am concerned about breaking something and was thinking, to be extra cautious, that I might want to duplicate the site into a sub-folder to work on it, that way the original site remains untouched until I see if I can fix it.

    Obviously, since I can’t get to the WP login page, I can’t use a plug-in to assist with this. Is there a reasonable way to do this, or is it more work than it’s worth? Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Thread Starter mixmethods

    (@mixmethods)

    Thanks! Ok, I think I almost have it working on the local host, but ran into a snag.

    I got a fresh install of WordPress running on my local host with a fresh database, just to make sure it works.

    The next thing I did was import the entire WordPress folder into the local MAMP folder. I also exported the original MySQL database from the server and imported it to the local phpmyadmin.

    I then changed the wp-config.php file to reflect the DB name, user, and password of the imported database. (should the hostname just be ‘localhost’?)

    It unfortunately will not yet load the webpage, but it feels like I’m really close. Is there a step that I’m missing?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Are you getting an error message, or is this a mamp issue? Can you access anything, not just WordPress, on your mamp server? E.g. can you view a html file?

    Thread Starter mixmethods

    (@mixmethods)

    Ah, yes an html file will pull up correctly.

    Specifically: The copied wordpress site is in the folder “wordpresstest”. Based on your suggestion, I tried localhost:8888/wordpresstest/index.htm and it worked. But, if I try localhost:8888/wordpresstest/, it just says “webpage not available”.

    As I mentioned, it worked correctly when I did a fresh install, but it’s not working with the copied site and database.

    Thread Starter mixmethods

    (@mixmethods)

    Side note that might help: If I change the database password to something other than “root” in wp-config, it says when I try to load the page: “Error establishing a database connection.”

    If I change it back to “root” it then simply says “this webpage not available” (doesn’t load anything) in Chrome. This was essentially my process:

    1. Copy wp-content folder
    2. Export database
    3. Import database
    4. Paste wp-content folder.
    5. Configure config.php

    Did I miss something, or is there something unique with MAMP that I’m not accounting for?

    Thread Starter mixmethods

    (@mixmethods)

    Figured it out! In case anyone else runs into this: You need to make sure to change the siteurl in wp_options in the database, and also change the site address in WordPress settings: https://www.youtube.com/watch?v=PKsWwvcuHyo

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Duplicating/cloning a broken/hacked WordPress site’ is closed to new replies.