Learn about Centmin Mod LEMP Stack today
Register Now

Transfer database from MariaDB 10.0.23 to MariaDB 10.0.23

Discussion in 'System Administration' started by pamamolf, Feb 1, 2016.

  1. pamamolf

    pamamolf Well-Known Member

    3,113
    295
    83
    May 31, 2014
    Ratings:
    +530
    Local Time:
    6:10 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Hi

    I have a server running MariaDB 10.0.23 and i want to move the database to another server running exactly the same version :)

    Dumping the database to .sql and importing it is always ok for me but the database is big like 60gb uncompressed and it will take a lot of time...

    Can i just set the databse as read only and rsync the folder and the contents in it from /var/lib/mysql/database_folder/* ?

    Any tips?

    Thank you
     
  2. Sunka

    Sunka Well-Known Member

    999
    275
    63
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +451
    Local Time:
    5:10 AM
    Nginx 1.15.0
    MariaDB 10.2.15
    Rsync mysql database files? | Centmin Mod Community
    You asked question, @eva2000 answered => MariaDB - Migrating site db, the fastest way? | Centmin Mod Community

     
    Last edited: Feb 1, 2016
    • Like Like x 1
  3. eva2000

    eva2000 Administrator Staff Member

    35,992
    7,896
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,174
    Local Time:
    1:10 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  4. pamamolf

    pamamolf Well-Known Member

    3,113
    295
    83
    May 31, 2014
    Ratings:
    +530
    Local Time:
    6:10 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    There is no space left to compress it on the disk :(
     
  5. eva2000

    eva2000 Administrator Staff Member

    35,992
    7,896
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,174
    Local Time:
    1:10 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    that's why choosing server hardware spec's is important for cpu, ram and disk space ;)

    looks like you'd need to somehow free some space and/or do a direct mysqldump + pipe to the remote server as outlined at https://community.centminmod.com/posts/22702/

    rest is up to you.. or hire someone professionally as doing this incorrectly, could mean corrupted database and data !
     
    • Informative Informative x 1
  6. dorobo

    dorobo Active Member

    420
    104
    43
    Jun 6, 2014
    Ratings:
    +162
    Local Time:
    11:10 AM
    latest
    latest
    what about stopping MariaDB first on both servers and then rsync?
     
  7. rdan

    rdan Premium Member Premium Member

    4,255
    1,034
    113
    May 25, 2014
    Ratings:
    +1,486
    Local Time:
    11:10 AM
    Mainline
    10.2
    I don't know if this reliable, but be sure to have exact my.cnf config.

    Or the best way is to run mysqldump on remote server.
     
  8. pamamolf

    pamamolf Well-Known Member

    3,113
    295
    83
    May 31, 2014
    Ratings:
    +530
    Local Time:
    6:10 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    This is what i was thinking to do and if will not work then i will do a mysqldump :)
     
  9. eva2000

    eva2000 Administrator Staff Member

    35,992
    7,896
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,174
    Local Time:
    1:10 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    you'd have rsync everything in /var/lib/mysql and ideally destination /var/lib/mysql should be empty
     
    • Like Like x 1
    • Informative Informative x 1
..