Forums

[resolved] How to clean the database? (6 posts)

  1. kramer65
    Member
    Posted 1 year ago #

    Hello,

    For the past months we've been building a wordpress video-blog with which we're now pretty much finished. Since we want to go live next week I just wanted to clean the database. We can get rid of pretty much all data in it.

    When I delete stuff in the wp-admin however, the next post I create just has the next id_number (something like 2000 by now).

    I now want to clean the database so that it has really been cleaned properly and I can start from number 1 again. Is there a way to do this?

    Any tips and hints welcome!

  2. kramer65
    Member
    Posted 1 year ago #

    Nobody any idea..? (bump)

  3. Geez, don't bump. You'll annoy the zoo volunteers.

    (Sips more coffee)

    ID number don't matter worth a darn; use fancy permalinks and no one will ever know. When you export the blog to a WXR file it preserves the ID so renumbering them will be virtually impossible.

    See Otto's post here and that thread for some info.

    If you want to start from scratch anyway and re-import your posts, pages, and comments then try exporting, changing your table prefix, and start anew by re-importing that WXR file.

    Backup your files and database and store it in a completely safe place.

    http://codex.wordpress.org/WordPress_Backups
    http://codex.wordpress.org/Backing_Up_Your_Database
    http://codex.wordpress.org/Restoring_Your_Database_From_Backup

    Export your blog into a WXR file.

    http://codex.wordpress.org/Tools_Export_SubPanel

    Now comes the fun part. Edit your wp-config.php file (you did make that full backup, right?) and change the table prefix from whatever you had to something else.

    So if the line read

    $table_prefix  = 'wp_';

    Change it to something else (vb for video blog?)

    $table_prefix  = 'vb_';

    Now visit your blog. Don't freak out! But do re-install your blog. The tables are all new and empty so you'll need to re-activate your plugins, select your theme, widget, set the options, etc.

    Your old blog is 100% still there and intact but by changing the table prefix you create a new set of tables.

    Now import the WXR file. The importer will install the WordPress importer plugin and your data will be there.

    Once that's done you should have just the posts, pages, comments, and revisions (I think). If something goes wrong or you don't like the outcome them change the table_prefix back to the old settings and you'll be right back where you were.

    If something really goes wrong then restore the backup you made.

  4. kramer65
    Member
    Posted 1 year ago #

    Ok, I'm sorry. It is indeed true that I really really apreciate the feedback people are giving, and thus there should be no such thing as "demanding people" like me on forums like these.. :S

    Nonetheless I really apreciate your answer as well! I Think that in this case I'll just leave things the way they are..

    I'll maybe do a "Optimize tables" in phpmyadmin. That wouldn't hurt right?

    Thanks again!

  5. I'll maybe do a "Optimize tables" in phpmyadmin. That wouldn't hurt right?

    That wouldn't hurt and would probably help. Just make sure you have those backups as a just in case and it's hard to go wrong.

  6. kramer65
    Member
    Posted 1 year ago #

    Alright. Thanks a lot!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags