I recently had to migrate an entire blog from one installation to another. WordPress does have an export function, and there are many database backup plugins and managers, but these really only work well with a basic installation that doesn’t use any plugins that created tables. So, in my case, I couldn’t find anything that enabled me to move the Simple Tagging tags from one blog to another – easily.
Why am I still using Simple Tagging, you may ask, if shiny new WordPress 2.3 has tags built-in?
The answer, my friends, is that most of my blogs are still running on 2.2.x, and that is because I try to install all my WordPress sites with Fantastico, and Fantastico has still not upgraded to 2.3. But once I’ve got my Simple Tagging tags in my new blog, they can be automatically integrated into 2.3’s tagging system once I upgrade.
I finally figured out how to move the whole blog, tags and all, using phpMyAdmin, so here are the directions in case anyone else may find they need them. These directions can be applied to migrating any plugin databases to an entirely new installation. Before you do any of this, backup ALL database files, and pray that nothing gets screwed up:
- Log in to phpMyAdmin for the old site. You can do this through your Control Panel, or I guess through complicated server commands. I’m a Control Panel gal myself.
- Click on the drop-down menu on the left and select the right database, or click on Databases in the main window, and then click on the database. You will now see a list of all the tables in this database.
- Click on the Export tab at the top of the page.
- There is an Export box at the top right-hand side of the main window. It lists all available tables in the database. Select the following by holding down Ctrl and clicking: wp_categories, wp_comments, wp_link2cat, wp_links, wp_post2cat, wp_post2tag (this is a Simple Tagging (ST) table), wp_postmeta, wp_posts, wp_stp_tags (ST table), wp_tags (ST table), wp_tag_synonyms (ST table), wp_usermet, wp_users. If you’re doing this for other plugin tables, just ignore the tables above that say (ST table) after them, and look for unique databases that are not in the list above (except wp_options – see below to find out why).
- Leave all the other options as they are, click on Save as file, leave the File name template as is, Compression can be None or zipped or gzipped – if your databases are really big, you might want to choose zip or gzipped so that the download (and later the upload), won’t take so long.
- Click Go.
- Save this file somewhere where you can find it easily.
- Now, go to the other database in phpMyAdmin. Depending on how your sites are set up, you may be able to access the database where you are right now, or you may need to login to phpMyAdmin somehwere else.
- Once you have clicked on the correct database, delete all the tables that have the same name as the ones listed above in step 4. The reason for this is that you are going to be importing the tables from the old blog, and when phpMyAdmin sees a file with the same name, it won’t import it and will skip it. In short, phpMyAdmin does not synchronize tables. To delete the files quickly, select each table you want to delete by checking the box on the left of it, and then scroll to the bottom of the list of tables to a drop-down box that says “With selected:”. Click on that, and select Drop. That will delete all the selected tables.
- Now, click Import. Under File to Import, browse to find the file you exported in Steps 4-6. Leave all the other settings, and press Go.
That’s it! Now hopefully your new blog works and has all the info from the old one. If it doesn’t, you’ll just restore all your backups and try again!
You may have noticed that we ignored a table in both blogs called wp_options. The reasons for this is that it seems that this file records the domain and URL for the blog. So if your old blog was at www.mydomain.com, and your new one is at www.yourdomain.com, the first domain will appear in the second blog. This can screw things up pretty royally in terms of folders and files for the blog. Believe me, I know. At one point I couldn’t even get into the Options page in the WordPress admin anymore.
I hope I didn’t miss anything in the steps, and I hope this helps!