Recover from a WordPress Malware Hacking Attack by Switching Web Hosts - Upload files to your new web host
(Page 4 of 4 )
Step 2. Add your domain to your new hosting account. Some hosting companies require you to add your domain first in their hosting control panel before you can use FTP to upload files.
Step 3. Create a database in your new web host. This is your WordPress database.
Step 4. Using the XAMPP local host phpmyadmin, go to the wp_options table of your WordPress database. Find the following option name and change the following values (these are examples only; replace with your exact domain).
The following screen shot below assumes your domain is http://www.thisisyoursampledomain.com
Remember that those two settings above are the most important, but if you are uploading files to WordPress using the CMS/admin panel, then you should also change the upload_path. Here is an example path:
/home/www/php-developer/wp-content/uploads
Step 5. Revise your .htaccess and wp-config.php with settings for the new web host.
Default .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Note: You can use your old .htaccess
Important lines in wp-config.php (replace items in red):
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'yourdatabasename');
/** MySQL database username */
define('DB_USER', 'yourdatabaseusername');
/** MySQL database password */
define('DB_PASSWORD', 'yourdatabasepassword');
/** MySQL hostname */
define('DB_HOST', 'yourdatabasehostname');
Step 6. Once all the files are ready, upload it to your new web host root directory. Re-install WordPress and then empty all the tables (there are 10 tables) in the WordPress database.
Step 7. Import your MySQL database (containing all of your WordPress settings and posts in the old hacked website) to your new web host. This will fill the empty tables.
Step 8. Change passwords, etc; make sure they are different from the old site. You can further protect your website using CrawlTrack. Make sure to update your WordPress to the latest version.
Step 9. Complete the finishing touches; make sure that your website looks the same as before (except that it is now clean and malware-free).
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |