Announcement

Collapse
No announcement yet.

Moved hosts ... now need to import database

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

  • Moved hosts ... now need to import database

    Hi Guys,

    We have now got a new host for our website.
    Last night I moved the entire public_html directory from our existing server into the htdocs directory on the new server.

    I now need to import the main mysql database.
    What is the correct procedure for doing this?

    Thanks
    Wayne

  • #2
    The only consistently reliable method of backing up and restoring a database is with shell access via telnet or ssh. This is because backing up with a PHP script like that in the Admin CP or phpMyAdmin can result in PHP timeout errors and an incomplete backup file.

    Please see the instructions here:

    Backup:
    http://www.vbulletin.com/docs/html/m...nce_ssh_backup

    Restore:
    http://www.vbulletin.com/docs/html/m...ce_ssh_restore

    If you don't have telnet or SSH access, some people have reported success with these scripts:

    MySQLDumper:
    http://www.mysqldumper.de/en/index.php

    MySQLHotxcopy:
    http://www.vbulletin.com/forum/showt...t=mysqlhotcopy
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      Hi Steve,

      Thank you for the quick reply.

      The SSH access to our old hosts is currently not working. However, I have got a recent copy of the database file.

      I have just tried to import the database file using the method that you linked to but I got the error below:

      [[email protected] waynetemp]# mysql -u braindg_D4tFaY2o -p braindg_clubvr4db < braindg_clubvr4db.sql
      Enter password:
      ERROR 1045 (28000): Access denied for user 'braindg_D4tFaY2o'@'localhost' (using password: YES)
      [[email protected] waynetemp]#

      I know that the user name and password are correct as I took them from our current config.php file which accesses this database OK on our current site.

      Please help.

      Thanks
      Wayne

      Comment


      • #4
        Did you add user braindg_D4tFaY2o to the database? Happens a lot
        Lats...

        Comment


        • #5
          Yes. The user name and password I am using are the exact same that are in the config.php file and that works just fine.

          Comment


          • #6
            Sorry, you did say that

            Try a FLUSH PRIVILEGES then restart mysql.
            Lats...

            Comment


            • #7
              Thanks Lats. I will give that a try if I can work out the commands

              Meanwhile ... I have managed to get our "old" hosts to enable SSH access again so managed to do a database backup using the technique that Steve eluded to above. I am just downloading the (near 600MB) file to my local Linux machine.

              So ... when I try the import again later I will use the freshly generated backup file rather than the one that was generated by the cPanel backup script on the "old" host server.

              Comment


              • #8
                OK, the database has been uploaded to the new server via FTP but I am having problems importing it using the instructions provided. See output below:

                [[email protected] clubvr4-1]# mysqladmin -u root -p flush-privileges
                Enter password:
                [[email protected] clubvr4-1]# /etc/init.d/mysql.server stop
                Shutting down MySQL... [ OK ]
                [[email protected] clubvr4-1]# /etc/init.d/mysql.server start
                Starting MySQL. [ OK ]
                [[email protected] clubvr4-1]# ls -l *.sql
                -rw-r--r-- 1 clubvr4 www 613073525 Apr 1 14:51 clubvr4db.sql
                [[email protected] clubvr4-1]# mysql -u braindg_D4tFaY2o -p braindg_clubvr4db < clubvr4db.sql
                Enter password:
                ERROR 1045 (28000): Access denied for user 'braindg_D4tFaY2o'@'localhost' (using password: YES)
                [[email protected] clubvr4-1]#

                Any ideas what's wrong ... I am rather confused

                Comment


                • #9
                  The most likely cause of this error is that the this database does not exist or that db user does not have full permissions to this database.
                  Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                  Change CKEditor Colors to Match Style (for 4.1.4 and above)

                  Steve Machol Photography


                  Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                  Comment


                  • #10
                    Thanks Steve.

                    Does that mean I have to create a new database with the same name first? And then import database backup into the database?

                    And does the database user have to be created on the local system?

                    Sorry if these are dumb questions but this is all new to me ...
                    Last edited by WayneH; Fri 1 May '09, 2:57am.

                    Comment


                    • #11
                      Yes and yes.
                      Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                      Change CKEditor Colors to Match Style (for 4.1.4 and above)

                      Steve Machol Photography


                      Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                      Comment

                      Loading...
                      Working...
                      X