Perform a database restore

Collapse
X
Collapse
 

  • admin
    started a blog post Perform a database restore

    Perform a database restore

    1. Switch Vbulletin off in Admin Control Panel - Settings - Options - Switch Vbulletin On/Off.

    2. Create an SSH connection to your web server with PuTTY.

    3. At the command prompt navigate to your backup folder eg.
    Code:
    cd /home/mywebsite/backups
    4. Call up a list of your backups with
    Code:
    ls -l
    5. Identify the filename of the last known good backup you have that you want to restore.

    6. Uncompress the backup by typing the following at the command line -
    Code:
    gunzip yourdbbackupfile.sql.gz
    7. From the command prompt login to MySQL by typing
    Code:
    mysql -u yourMySQLusername -pyour MySQLpassword
    (note the deliberate lack of space after -p)

    8. At the MySQL prompt type
    Code:
    use yourdbname;
    and hit enter.

    9. Type
    Code:
    truncate yourdbname;
    and hit enter. This removes all the current data but retains the database structure.

    10. Type
    Code:
    source /fullpathtoyourdbbackup.sql;
    and hit enter. This restores your database backup.

    11. Type
    Code:
    quit
    and hit enter to exit MySQL.

    12. At the command line re-compress your database backup file by tying
    Code:
    gzip /fullpathtoyourdbbackup.sql
    and hit enter.

    13. Switch Vbulletin back on in Admin Control Panel - Settings - Options - Switch Vbulletin On/Off.


    Your database restore is complete.
      Posting comments is disabled.

    Related Topics

    Collapse

    Working...