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 Premium Member Premium Member

    3,167
    304
    83
    May 31, 2014
    Ratings:
    +551
    Local Time:
    11:28 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

    1,068
    292
    83
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +473
    Local Time:
    10:28 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

    38,013
    8,340
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,853
    Local Time:
    7:28 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  4. pamamolf

    pamamolf Premium Member Premium Member

    3,167
    304
    83
    May 31, 2014
    Ratings:
    +551
    Local Time:
    11:28 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

    38,013
    8,340
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,853
    Local Time:
    7:28 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:
    5:28 PM
    latest
    latest
    what about stopping MariaDB first on both servers and then rsync?
     
  7. rdan

    rdan Premium Member Premium Member

    4,500
    1,079
    113
    May 25, 2014
    Ratings:
    +1,576
    Local Time:
    5:28 PM
    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 Premium Member Premium Member

    3,167
    304
    83
    May 31, 2014
    Ratings:
    +551
    Local Time:
    11:28 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

    38,013
    8,340
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,853
    Local Time:
    7:28 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
..