SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict heropage's Avatar
    Join Date
    May 2004
    Location
    canada
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to transfer a big database?

    My database is 300M, how to transfer to another server.
    maybe mysqldump,any expericence about this?

  2. #2
    SitePoint Zealot swiftone's Avatar
    Join Date
    Mar 2005
    Location
    Sunny Florida
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mysqldump is one method. I have also known some to just copy the raw file into the same directory and Mysql finds the database after restarting. However, I won't vouch for this method. Perhaps someone else has experience with this.
    Happy Coding,
    Swiftone

    Unique Web Sites

  3. #3
    SitePoint Zealot newspire's Avatar
    Join Date
    Mar 2005
    Location
    Houston, TX
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd copy the db files. Just make sure no writes happen while you are copying. The easiest way is to just shutdown both mysql servers and copy the files. If your main server can only be down a short time then this is the fastest way to do the copy.

    first copy all your db files to another directory on the same server (with mysql running).

    Then flush all tables with readlock. This will prevent writes to your tables.

    Then copy just the files that have changed since the first copy. cp -uav

    Unlock the database.

    Now you have a snapshot of your db that you can copy to your other server.


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
  •