Join the community today
Become a Member

MariaDB Migrating site db, the fastest way?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by RoldanLT, Jun 1, 2014.

Tags:
  1. RoldanLT

    RoldanLT Well-Known Member

    3,975
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    11:30 AM
    1.11
    10.2
    I think this is the fastest way:
    Code:
    rsync /var/lib/mysql
    Do you recommend it? :)
    Does have dis advantages?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,906
    6,908
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,404
    Local Time:
    1:30 PM
    Nginx 1.13.x
    MariaDB 5.5
    nooooooooo do not do that especially with InnoDB tables, you can end up breaking stuff ! Only time you'd do that is if you have MySQL server on both source and destination servers shutdown and the destination server is a virgin fresh /var/lib/mysql setup that hasn't been used yet. The order and process is delicate e.g. you don't want your MySQL tables being written to while doing such a file transfer.

    Safest way is to mysqldump to sql file and rsync the file and reimport into new server. Difference in time between safest vs fastest isn't that much different if you do it right the first time (and if source and destination servers are on the same local web host network)

    InnoDB files can not be moved the same way like MyISAM files or you will end up corrupting MySQL InnoDB tables if you are not careful.
     
    • Like Like x 3
  3. RoldanLT

    RoldanLT Well-Known Member

    3,975
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    11:30 AM
    1.11
    10.2
    Thanks for the heads up :)