Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    I downloaded backups for my blog and a forum that I hosted when I decided to change hosts, and I have the .sql files, but can't import them into the new database because phpMyAdmin says that the tables already exist. Is there anyway to get the information only from the files?
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Well, there should be a bunch of CREATE TABLE statements in there. Those are probably the ones that are the problem. Get rid of them, and all the INSERTs should work.

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Or just drop all the tables and run your script. Only works if the software that access the SQL (phpBB, whatever) is the same version.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  5. #4
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    Quote Originally Posted by Shadowfiend
    Well, there should be a bunch of CREATE TABLE statements in there. Those are probably the ones that are the problem. Get rid of them, and all the INSERTs should work.
    So delete everything like this:

    Code:
    CREATE TABLE `wp_categories` (
      `cat_ID` bigint(20) NOT NULL auto_increment,
      `cat_name` varchar(55) NOT NULL default '',
      `category_nicename` varchar(200) NOT NULL default '',
      `category_description` longtext NOT NULL,
      `category_parent` bigint(20) NOT NULL default '0',
      `category_count` bigint(20) NOT NULL default '0',
      PRIMARY KEY  (`cat_ID`),
      KEY `category_nicename` (`category_nicename`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!

  6. #5
    Senior Member Steax's Avatar
    Join Date
    Dec 2006
    Location
    Bandung, Indonesia
    Posts
    1,207
    Member #
    14572
    Yes. An exported file is actually just all the SQL queries needed to recreate the entire database, including the table creations.
    Note on code: If I give code, please note that it is simply sample code to demonstrate an effect. It is not meant to be used as-is; that is the programmer's job. I am not responsible to give you support or be held liable for anything that happens when using my code.

  7. #6
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    I did all that and only recovered one post.... Darn it all.

    Thanks for your help everyone.
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!

  8. #7
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    Do you still have access to the old database throught PHPmyadmin. When you exported the tables did you check the DROP TABLES IF THEY EXIST option? if not try that and it should work, it has for me in the past
    Regards Phil,


  9. #8
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Yeah, it may work better if you just drop all the tables and then recreate them. It may, of course, also kill everything. Up to you whether you want to give it a shot or not :-)

  10. #9
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    Youcan always make a back up of the curernt tables though or try it on a different server?
    Regards Phil,


  11. #10
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    Well my problem was that I was changing hosts, because the first had become unreliable, especially concerning MySQL databases. So wanted to transfer my blog posts and forum over to the new one. I got the blog database to work by doing what Shadowfiend said, but only got one post out of it.
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:35 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com