Discover Centmin Mod 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

    4,100
    428
    83
    May 31, 2014
    Ratings:
    +837
    Local Time:
    9:49 AM
    Nginx-1.26.x
    MariaDB 10.6.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,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    8:49 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    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
  3. eva2000

    eva2000 Administrator Staff Member

    55,163
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:49 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  4. pamamolf

    pamamolf Premium Member Premium Member

    4,100
    428
    83
    May 31, 2014
    Ratings:
    +837
    Local Time:
    9:49 AM
    Nginx-1.26.x
    MariaDB 10.6.x
    There is no space left to compress it on the disk :(
     
  5. eva2000

    eva2000 Administrator Staff Member

    55,163
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:49 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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 !
     
  6. dorobo

    dorobo Active Member

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

    rdan Well-Known Member

    5,449
    1,410
    113
    May 25, 2014
    Ratings:
    +2,204
    Local Time:
    2:49 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

    4,100
    428
    83
    May 31, 2014
    Ratings:
    +837
    Local Time:
    9:49 AM
    Nginx-1.26.x
    MariaDB 10.6.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

    55,163
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    4:49 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    you'd have rsync everything in /var/lib/mysql and ideally destination /var/lib/mysql should be empty