Earlier this year I shut down SEO Rewind, a satire website, in order to concentrate on this project. In addition to my lame posts and SEO comics, some very smart SEOs contributed to the site. In fact, the only reason anyone noticed the site was because of the content written by Joel Klettke, Nick Eubanks and Stuart McHenry.
Before I shut it down I exported the WordPress SQL database in case any of the authors asked for their work in the future. In hindsight, I should have used WordPress’s export function because it would have made restoring SEO Rewind a lot easier. My mission: Get my WordPress post data back.
- Remove create database command from old SQL file
- Use my host tool to create a new database
- Import my old SQL data using phpMyAdmin
- Upload a new WordPress installation to a sub-directory of my site
- Connect it to my new database that contains my old data
- Export from within WordPress
- Import the WordPress XML file
- Set up a landing page on SEO Rewind telling users what happened and provide navigation
- Create permanent (301) redirects for important links to their new homes on this website
- Have a mint hot chocolate
The problem with my scenario is that my SQL file includes the command to create a new database, something that isn’t allowed in a Network Solutions shared server environment.
If your host has similar restrictions, you may get an error message when trying to import a SQL file within phpMyAdmin or another database management platform. To get around this, I’ll edit the file removing the create database command and import it into a fresh database.
I’ll create a new database first using my host’s dashboard and back up my main database just in case. (If you’re not comfortable messing with databases, stop! Contact me if you’re unsure.)
Open the file, probably called localhost.sql, in a text editor, remove the create database command, save the file, fire up phpMyAdmin and click on import. (I kept the default settings.)
Make sure that database and USE are referencing the name of your new database or you’ll receive a permissions error. In this case, I created a new database with the same name as the old version. After you successfully import your old data, you’ll need to change the options table to reflect your new website.
Connect a New WordPress Site to Old WordPress Data
My new WordPress website with my old WordPress data is ready. Next I need to upload a new installation of WordPress and connect the data.
- Create a new directory in your website and upload the WordPress files
- Navigate to the directory to launch the setup page
- Enter the database information you used above (caution: if you used something other than wp_ as the table prefix, use that version instead. In my case I used seo_ which could be seen the SQL file)
- The setup is modifying the wp-config file shown below
Load your website in a browser and you should see your old data in terms of posts, categories, tags, even authors. When you first log into your WordPress dashboard you may get some plugin errors. You can ignore these for now. My primary objective was to export my WordPress data in a way that makes it easier and safer to import.
WordPress Important Tool
Now that I’ve got my XML export file, I can load the data safely using the Import Tool (Tools > Import).
Capturing Lost Link Flow
During SEO Rewind’s short life it accrued some external links and while I’m restoring the content, it wouldn’t hurt to restore some of the authority, too. Using ahrefs.com, I can see that there are some pretty good links I wouldn’t mind recovering for my new website. In order for that to happen, I need to identify what the old links were and redirect those pages to their new homes on this site.
First, I’ll set up a simple landing page on SEO Rewind to inform human visitors that it’s moved.
Next, I want to forward both humans and robots to the new addresses for these pages. 301 redirects or permanent redirects can help me recapture some of that authority I lost when the pages started returning 404 not found errors. Below is a sample of the redirects in my .htaccess file.
redirect 301 /outed-point-blank-seos-jon-cooper/719/ http://marketingchris.com/seo-rewind/outed-point-blank-seos-jon-cooper/ redirect 301 /google-unveils-ambitious-new-algorithm-update/650/ http://marketingchris.com/seo-rewind/google-unveils-ambitious-new-algorithm-update/ redirect 301 /darth-vader-talks-retargeting/802/ http://marketingchris.com/seo-rewind/darth-vader-talks-retargeting/
If you need help with anything in this post for your own site, let me know!