Reference for reinstalling a clean WP site

Because of the pesky Webarh infection, I’m reinstalling/restarting my sites with the old content but fresh installs + cleanup. I was hoping to be able to take the opportunity to get multisite working but… no such luck. In any case, this is just a list to remind myself of what I did and have to remember to do to get the bare basics of my old sites up before tackling things like plugins and themes and what not.

I’m referring to How To Completely Clean Your Hacked WordPress Installation and several articles in the WordPress’s Codex regarding installing, restoring and migrating WordPress.

If anyone finds the pieces or the whole of the list below useful as well, I’m just happy to share. Just note that I’m doing the export and import via WP way, which means fresh plugin installs and setting up as well.

I’m also doing a lot of extra steps as precaution and skipped a lot of detailed instructions (refer to the links above for those). I also have phpmyadmin access and can create and use multiple databases.

The LIST

1) Download clean WordPress install package from WordPress.org into computer. Extract and don’t do anything yet.

2a) Use the Tools > Export function to get a XML copy of site’s database that the WordPress’s official importer can use.

2b) Use WordPress Database Backup plugin and save a backup into computer. This is to restore the old database, for whatever purpose.

2c) Go to /wp-links-opml.php and save the .xml file for importing Blogroll (Links) later. Only visible links will be exported though, and link categories are not exported too.

2d) Go to Plugins page (preferably the one showing all plugins installed) and save a plain .html file into computer. This is for remembering what plugins were used.

2e) Go to /wp-admin/options.php and save a plain .html file into computer as well. This is for reference when restoring options. It may be confusing to look at, but it helps.

2f) With FTP, access web server download the entire ‘wp-content’ folder, .htaccess file, wp-config.php and whatever folder and files that has been added or modified in the past that is of use to the site. Keep the hierarchy of the files intact.

3) Delete the site’s files on the web server, all the folders and files. Even the additional folder and files since they have been downloaded. Check with webhost if unsure.

4) Create new database. Remember to jot down username and password for Step 5.

5) WordPress’s Famous 5-Minute Install.

6) If all everything went right, access the new site’s admin. Delete or edit the default created first Post (and its tagalong Comment) and Page if necessary.

7a) Go to Tools > Import, select WordPress and install the WordPress Importer.

7b) Import your old site content into your new site using the WordPress Importer. Note though that Media, Links and Settings are not imported.

8a) Either go to each Settings page and change each option to match what the old site have one by one, or go to /wp-admin/options.php and edit it all in one go. Refer to the options page previously saved in Step 2e if memory fails. If the old options page has something the new site doesn’t, chances are it is a plugin option.

8b) Remember to upload .htaccess file to new site using FTP if and after changing Permalink setting.

9a) Under Settings > Writing > Default Post Category, select what was the default category for the old site.

9b) Go to Posts > Categories, delete the category named ‘uncategorized’ or rename it for other uses.

10a) Go to Tools > Import, select Blogroll and install the OPML Importer.

10b) Import the previously saved .xml file in Step 2c for Blogroll (Links).

10c) Go to Links > Link Categories, rename and add link categories.

10d) Go to Links, delete whatever isn’t necessary and add link categories to each link one by one. Yes, there is no quick edit or bulk edit for Links, which majorly sucks.

11a) Using FTP, dump the folders and files in the old site’s /wp-content/uploads folder that is in computer to the new site’s /wp-content/uploads folder in the web server.

11b) Download Add From Server so the uploads can be imported into the Media > Library to be managed.

Extra 12) If there is a change of URL from old site to new site, remember to do mass edit URLs so that internal and media link are pointing correctly.

Everything should be more or less in place. I don’t know if having custom post types will change anything (I’m hoping it won’t).

If all is well, then on to tackle the theme and plugins, which would probably be an even bigger headache then restoring the bare basics. Old database hasn’t been deleted yet and old files have been downloaded, so there is some place to refer to.

If anything goes terribly wrong, remember that there are backups and they can be restore to start all over again.

Leave a Reply