SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Restoring DB

  1. #1
    SitePoint Member
    Join Date
    Jul 2003
    Location
    Utah
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Restoring DB

    I backed my forums (mySQL database) to a myfile.sql file through phpMyadmin 2.2.6 using table drops to backup the entire thing. But now I have no idea how to get the data back in! The file I want to use to update is like 20 megs and here is a portion of it. Is this right? Shouldnt this just import back in and repopulate my forum DB? Here is the first 20 or so lines from the exported file...

    Code:
    # phpMyAdmin MySQL-Dump 
    # version 2.3.3pl1 
    # http://www.phpmyadmin.net/ (download page) 
    # 
    # Host: localhost 
    # Generation Time: May 07, 2003 at 02:13 AM 
    # Server version: 3.23.36 
    # PHP Version: 4.1.2 
    # Database : `ohsforum` 
    # -------------------------------------------------------- 
    
    # 
    # Table structure for table `phpbb_attach_quota` 
    # 
    
    CREATE TABLE phpbb_attach_quota ( 
      user_id mediumint(8) unsigned NOT NULL default '0', 
      group_id mediumint(8) unsigned NOT NULL default '0', 
      quota_type smallint(2) NOT NULL default '0', 
      quota_limit_id mediumint(8) unsigned NOT NULL default '0', 
      KEY quota_type (quota_type) 
    ) TYPE=MyISAM; 
    
    # 
    # Dumping data for table `phpbb_attach_quota` 
    # 
    
    # -------------------------------------------------------- 
    
    # 
    # Table structure for table `phpbb_attachments` 
    # 
    
    CREATE TABLE phpbb_attachments ( 
      attach_id mediumint(8) unsigned NOT NULL default '0', 
      post_id mediumint(8) unsigned NOT NULL default '0', 
      privmsgs_id mediumint(8) unsigned NOT NULL default '0', 
      user_id_1 mediumint(8) NOT NULL default '0', 
      user_id_2 mediumint(8) NOT NULL default '0', 
      KEY attach_id_post_id (attach_id,post_id), 
      KEY attach_id_privmsgs_id (attach_id,privmsgs_id) 
    ) TYPE=MyISAM; 
    
    # 
    # Dumping data for table `phpbb_attachments` 
    # 
    
    INSERT INTO phpbb_attachments (attach_id, post_id, privmsgs_id, user_id_1, user_id_2) VALUES (1, 4543, 0, 2, 0); 
    INSERT INTO phpbb_attachments (attach_id, post_id, privmsgs_id, user_id_1, user_id_2) VALUES (2, 4543, 0, 2, 0);
    That is just the first part. It also has all the actual data. That is right isnt it? Where/how do I get all that data back into my DB?

    Thanks for anyhelp!

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Go into phpMyAdmin. Select your database if you have more than one. Go to the "SQL" tab in the right hand side.

    Below the text box that lets you type in your own queries, is "Or location of the textfile:". Hit the browse button, select the file you're talking about above, and click Go. That should read in the file and execute all the queries inside of it.

  3. #3
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hmm..20 megs you say.. submitting through a form might take a while to do 20 megs...

    You can also do this manually. Copy a big chunk of your file, paste it into the big textbox on that page in phpMyAdmin that I was talking about above, and it'll execute those queries. Copy/paste the next piece of your text file, etc until you're done...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •