SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member cyberdave2k1's Avatar
    Join Date
    May 2001
    Location
    Sacramento, CA
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Moving Entire MySQL Database

    HELP!!

    I've got a web site that needs to be moved to another server hosted by someone else. How do I move the entire database over? If I FTP, I can't find the file. This is of course on a Linux server moving over to another Linux server.

    The web site is www.amadorflowerfarm.com and the database contains flowers with properties and prices, etc.

    Thanks for helping me out.

    Cyber

  2. #2
    SitePoint Evangelist AlexC's Avatar
    Join Date
    Oct 2000
    Location
    Sheffield, UK
    Posts
    437
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, i'm not entirly sure, but i think phpmyadmin can do this-->http://www.phpwizard.net
    Nearly 7 years old!

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2000
    Location
    England
    Posts
    587
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yep you could use Phpmyadmin..

    Yuo could also use telnet to dump the db into a .sql file, dl it and then upload it to the new server and dump the .sql file into the new database..
    Wannabebig Bodybuilding
    Wannabebig Bodybuilding Forums - Wanna be bigger and stronger?
    At Large Nutrition - nutritional supplements

  4. #4
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use the mysqldump command -- I prefer doing something like this manually, if it's a reasonably delicate situation. It goes like this, if I remember correctly:

    mysqldump -hlocalhost -u(USERNAME) DBNAME > backup.sql

    Do this from the bash prompt in TELNET -- don't login to MySQL! I hit my head against the keyboard a few times figuring that out the first time. Stupid, huh?

  5. #5
    SitePoint Guru DeNasio's Avatar
    Join Date
    May 2001
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mysqldump -hlocalhost -u(USERNAME) DBNAME > backup.sql
    I have a few questions about this:

    1. How about the security? Don't you need to enter the password of the database somewhere?

    2. Where will the file be saved? I would rather it be saved on my harddisk!

  6. #6
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know about the security -- I would imagine that would be related to the client you're using -- TELNET by itself is not secure, but if you're running, say, Putty, I think it should be okay. IE: I may be wrong, but I think the backup is as secure as the client program.

    The command above should save it to your root directory. Then you can transfer it to your hard drive via FTP. You can specify a directory as well...so backup.sql becomes files/backups/backup.sql, or something similar.

  7. #7
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AS TWT stated this is the handsdown easiest way to move a database as far as I am concerned. De Nasio as for the password just add it in there like this

    $>mysqldump -hlocalhost -u(USERNAME) -p DBNAME > backup.sql

    Now whatever folder you were in when you ran the command a file with the name you specify in the command will exist there with a dump of the db. Now either move it to a folder that you can ftp into with

    $>mv backup.sql /path/to/your/user/dir/

    Or mail it to yourself if its not too big like this

    $>uuencode backup.sql backup.sql | mail you@yourdomain.com


    Then upload it with ftp to your new server and telnet into it. Now run the commands in reverse.

    $>mysqladmin create dbname
    $>mysql -u username -p dbname < backup.sql


    Now you are done.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


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
  •