Results 1 to 3 of 3
  1. #1

    Backing up database data

    I want to use rsync to backup my machines, but am not sure exactly how to do the databases. Can I just rsync the dirs with all the database info, or do I have to export the databases and rsync the resulting text/zip file? I'd have to backup MySQL and PostgreSQL. Also, how would I restore the db from the backup if I can just rsync the files instead of exporting to a text file?

  2. #2
    Depends on the size of your database and the amount of updates and how much space you have

    If you have a fairly small database, and enough space the best way would be to just dump the database info with mysqldump --opt > database$date.sql this way you can keep multiple backups (preferably you can dump from remote machine)

    If your database is relatively large and you are short on space you can use rsync to copy the database folder but you have to stop the database server before starting rsync (or read lock all tables in database)

  3. #3
    I don't think you can just rsync the files,. If your tables or databases are being written to while you are rsynching the files you won't be able to obtain a valid backup of whatever table is open.

    You can do a mysql hotcopy command and dump the contents of your database to a folder and then you can rsync that folder on your other server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •