Backing Up & Restoring the Database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Andy
    Senior Member
    • Jan 2002
    • 5886
    • 4.1.x

    Backing Up & Restoring the Database

    Backing up procedure
    Using telent type:

    mysqldump -r database > /home/web_site/public_html/backup.sql

    Restoring procedure

    Before you can restore, copy this program found at this link written by imknight:



    Make this a .php program, ftp it to your web site, then run it from your browser. The program will delete all the tables in your database. Using telnet type:

    mysql -p database < /home/web_site/public_html/backup.sql
    Last edited by Andy; Wed 30 Jan '02, 11:13pm.
  • fury
    Senior Member
    • Jun 2001
    • 1464

    #2
    There is a much easier way than using a PHP program to drop all the tables beforehand

    When making the dump, use the --opt switch instead of -r

    as in mysqldump -udatabaseusername -p --opt > filename.sql

    This adds DROP TABLE commands before the CREATE TABLE and INSERT INTO commands, and also makes a smaller dump file size to boot.

    Comment

    • George L
      Former vBulletin Support
      • May 2000
      • 32996
      • 3.8.x

      #3
      --opt option also tells mysql not to load the entire database into memory prior to dumping
      :: Always Back Up Forum Database + Attachments BEFORE upgrading !
      :: Nginx SPDY SSL - World Flags Demo [video results]
      :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

      Comment

      • Figment
        Member
        • Oct 2001
        • 51

        #4
        How is this done with a host that does not provide Telnet or Shell access?

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...