0

Does a website using a database, need to be shut down when a backup is being made? (assuming you are not using replication)?

[Edit]

Apologies about the brevity of the question. I have provided more details below:

  • OS: Ubuntu Lucid Lynx (10.04 LTS)
  • web application framework: Symfony (PHP web framework)
  • databases: mysql (v5.1) AND postgresql (v 8.4)

Additional files that need to be backed up:

  1. configuration files (php.ini, httpd.conf etc)
  2. data files in specific folders
  3. cron jobs (bash scripts, PHP scripts, Python scripts, Ruby scripts)

more specific information that may be relevant:

I am running the site on a private virtual server (so I have root access), on a machine hosted on Linode.

  • 2
    In order to provide specific information can you answer the following? 1: What OS is the server running? 2: what database type/engine? most likely it does not have to but shut down at all but in order to provide a better answer we need more details. – Luma Jul 10 '10 at 02:42
  • When asking a question please ask the WHOLE question, providing enough information to allow that question to be answered. The title should also be consistent with the question body but not be part of it. In your case the title asks something very different to what is in the body. The better you ask the question the better we can answer it. – John Gardeniers Jul 10 '10 at 03:49

2 Answers2

4

Use mysqldump to back up the mySQL database.

Use pg_dumpall to back up the postgres database.

Use rsync to back up the website files.

You don't need to shutdown the database whilst making the back-up, though depending on the underlying engine used, tables may be locked whilst the dump is running.

Pete
  • 301
  • 1
  • 4
  • A good script that uses mysqldump: AutoMySQLBackup, http://sourceforge.net/projects/automysqlbackup/ – churnd Jul 11 '10 at 15:39
0

It depends on your database. Mysql has possibilities to do hot dumps if you use the right database engine.

txwikinger
  • 943
  • 7
  • 14