Converting a WP.org Site To WPMU

I have a lot of WordPress sites I manage and I’ve been thinking about converting them to WordPress MU sites to consolidate management. Today I attempted the first one, about.Scriblio.net. There’s no proper way of doing it that I found, but here’s what I did:

  • Create a new site in MU
  • Create the users in the correct order (user ID numbers must match)
  • Replace the posts, postmeta, comments, terms, term_taxonomy, and term_relationship tables with those from the original blog
  • Copy the contents of wp-content/uploads to wp-content/files
  • Update the posts table with the new path (both for regular content and attachments, see below)
  • Hope it all worked

Somebody is likely to say “just export the content in WordPress XML format and import it in the new blog,” but that person doesn’t use permalinks based on post_id. Doing the export/import dance destroys post_id-based permalinks, and that’s a bad thingâ„¢.

The MySQL queries to update the posts with the new upload location:

  • for “regular content”
    UPDATE {new_posts_table}
    SET post_content = REPLACE(post_content, '/wp-content/uploads/', 'scriblio.net/wp-content/files/')
    WHERE post_content LIKE '%/uploads/%'
  • for the attachments
    UPDATE {new_posts_table}
    SET guid = REPLACE(guid, '/wp-content/uploads/', 'scriblio.net/wp-content/files/')
    WHERE guid LIKE '%/uploads/%'

2 Comments

  1. Comment by Chand on June 22, 2008 1:54 pm

    Hi i m chand

  2. Pingback by WordPress blogok importálása WordPress MU-ba at élet és könyvtár on October 7, 2008 6:30 am

    [...] illetve úgy néz ki, hogy így fog történni. Casey Bisson neve az olvasóimnak biztos ismer?s. Pár napja ? írta le azt a módszert, amelyet mihelyt lehet, én is ki fogok próbálni, de addig is jöjjön a fordítása, hátha [...]

Comments RSS TrackBack Identifier URI

Leave a comment

 

User contributed tags for this post:

1