WordPress.org

Ready to get started?Download WordPress

Forums

Restoring SQL database with a different prefix (7 posts)

  1. lanemcf
    Member
    Posted 9 years ago #

    I hope some MySQL guru can help me here.

    I was previously running WP 1.2, and decided to upgrade to 1.5. I had an SQL database where the tables had the prefix "wp_" -- I saved this database to an *.sql file to back it up.

    The upgrade didn't go well, I got frustrated, and eventually did a clean install. I tried to use the old database, but lo and behold, WP wouldn't permit it, saying "it appears you've already installed WordPress." So in my root/wp/wp-config.php file, I set the following variable:
    $table_prefix = 'wp2_';

    This gave me a fresh installation of WordPress, using the same SQL database as before, but with two sets of tables, wp_table and wp2_table.

    Now what I want to do is to import my backed-up SQL file so as to recover my old posts and comments. If I do a standard backup [codex.wordpress.org], then the information simply returns to the old tables with the "wp_" prefix, which isn't being read by my new installation of WP 1.5.

    My question, I suppose, is this: is there a way to conduct the reimportation of database information, but to alter the prefixes in the process? I'd like to put the "wp_" information into the newer "wp2_" tables. My follow-up question is, since these tables have all sorts of information other than just post and comment content, is doing this going to totally ruin my new installation? Are my old posts gone forever?

  2. lanemcf
    Member
    Posted 9 years ago #

    The URL of my blog is http://www.lanemcfadden.net in case that's useful.

  3. Mark (podz)
    Support Maven
    Posted 9 years ago #

    What 'didn't go well' ?
    I've imported and rescued a number of databases from a variety of errors and though I've tried to write a guide it's not a 1-2-3 type of task.
    If you want to email me, I'll help as much as I can.
    Firstly I'd need your original .sql file which I will test, then once I have that working, if you give me access to your database I'll get it all back in and running.
    Until I actually see the file I can't promise, but I've not failed yet :)

    tamba2 at gmail dot com

  4. lanemcf
    Member
    Posted 9 years ago #

    thank you Podz, I will email you the file.

  5. lanemcf
    Member
    Posted 9 years ago #

    Three cheers for Podz! He successfully fiddled in the database until the situation was resolved. For anyone who has this issue in the future, know that it can be fixed, but unfortunately I can't explain how.

  6. wpmubp
    Member
    Posted 8 years ago #

    oh I need to know the procedures!!

  7. marky
    Member
    Posted 8 years ago #

    I need these instructions as well. How do you change the prefix successfully?

Topic Closed

This topic has been closed to new replies.

About this Topic