Announcement

Collapse
No announcement yet.

Backing a live system up and restoring to a test server.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Backing a live system up and restoring to a test server.

    Hi,

    I wonder if anyone who has done this can take a moment to help me?

    I have an account with Ventures Online and want to take a backup of MySQL database and restore it onto a local system with VB installed. I want to have this enviorment so I can test hacks etc.

    I can install VB, no problem.

    However, my current install already has several hacks in place. Is it just a case of backing up the SQL database, or is it as I assume, a case of backing up all the PHP files as well?

    Can anyone help with the above, and also advise me onto how to backup my database and take a copy offline.

    Otherwise, thank you to the developers for an execellent product.

    Harvey.

  • #2
    to backup

    1. close forum
    2. log into ssh/telnet and type

    mysqldump --opt -u yourmysqlusername -p vbdatabasename > /home/username/public_html/backup.sql

    it will prompt you for your mysql password you created with your mysql user in cpanel's mysql module

    wait for return to command prompt

    3. download backup.sql via ftp or better yet if you have a download manager like flashget or getright point it to yourdomain.com/backup.sql to download


    4. if you have edited vB php files you need to copy them to your local system which they probably already exits on your local pc anyway

    5. reimport mysql on local pc depends on whether your local pc is linux or windows based

    for linux type in telnet

    mysql -u yourmysqlusername -p databasename < /path/to/where/you/saved/backup.sql

    for windows reimport

    mysql -u mysqlusername -p databasename < C:\directory\to\backup.sql
    :: 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


    • #3
      That's a great help, thank you for this.

      Two final questions if that's ok now I know what to do.

      When I close the board, if any members are logged on, are they kicked?

      Does anyone have an install guide for MYSQL for Windows?

      Thanks in advance.

      Harvey.

      Comment


      • #4
        1. members and visitors are greeted with a closed forum message you set when you close the forum

        2. easy way to install apache/mysql/php/perl/phpmyadmin for windows is to download and install www.nusphere.com
        :: 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


        • #5
          When hitting enter mine comes back and say's command not found?

          Comment


          • #6
            Originally posted by eg_92901
            When hitting enter mine comes back and say's command not found?
            some servers need to have the full path to the command instead

            try in shell type

            locate mysqladmin

            it might return something like

            /usr/local/mysql/bin/mysqladmin

            so you need to type

            to backup

            /usr/local/mysql/bin/mysqldump --opt -u yourmysqlusername -p vbdatabasename > /home/username/public_html/backup.sql

            to import

            /usr/local/mysql/bin/mysql -u yourmysqlusername -p databasename < /path/to/where/you/saved/backup.sql
            :: 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


            • #7
              This is what I get when I log in as admin and type locate mysqladmin:
              /usr/share/man/man1/mysqladmin.1.gz
              /usr/bin/mysqladmin


              I logged in under my site name and then type in:
              /usr/bin/mysqldump --opt -u yourmysqlusername -p vbdatabasename > /home/username/mainwebsite_html/backup.sql

              and I get an error saying:
              /usr/bin/mysqldump: No such file or directory

              If I log in under my admin name and type:
              /usr/bin/mysqldump --opt -u yourmysqlusername -p vbdatabasename > /home/username/mainwebsite_html/backup.sql

              I get an error saying /home/username/mainwebsite_html: No such file or directory

              And of course I'm filling in my site and database info

              Comment


              • #8
                you need root user privileges to run mysql client commands such as mysqladmin and mysql

                log into shell as normal user once inside type

                su -

                to switch to root user, you will be prompted for your server root password
                :: 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


                • #9
                  Ok, thanks. I got it working, Now I'm going to try and restore it on my test site.

                  Comment


                  • #10
                    Originally posted by eg_92901
                    Ok, thanks. I got it working, Now I'm going to try and restore it on my test site.
                    no probs
                    :: 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

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