User Tools

Site Tools


evergreen-admin:maintenance:backups

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
evergreen-admin:maintenance:backups [2008/06/28 22:47] – Improve example backup and restore commands dbsevergreen-admin:maintenance:backups [2011/05/05 15:02] aatre
Line 12: Line 12:
 Most of the critical data for an Evergreen system -- patrons, bibliographic records, holdings, transactions, bills -- is stored in the PostgreSQL database. You can therefore use normal PostgreSQL backup procedures to backup this data. For example, the simplest method of backing up the Evergreen database is to use the ''pg_dump'' command to create a live backup of the database without having to interrupt any Evergreen services as follows:<code bash> Most of the critical data for an Evergreen system -- patrons, bibliographic records, holdings, transactions, bills -- is stored in the PostgreSQL database. You can therefore use normal PostgreSQL backup procedures to backup this data. For example, the simplest method of backing up the Evergreen database is to use the ''pg_dump'' command to create a live backup of the database without having to interrupt any Evergreen services as follows:<code bash>
 # pg_dump -U <username> -h <hostname> -f <output-file> <database-name>  # pg_dump -U <username> -h <hostname> -f <output-file> <database-name> 
-pg_dump -U evergreen -h localhost -f evergreen_db.backup.2008-06-15 evergreen+pg_dump -U evergreen -h localhost -f evergreen_db.backup evergreen
 </code> </code>
-To restore the backed up database into a new database, create a new database using the ''template0'' database template and the UTF8 encoding, and run the ''psql'' command, specifying the new database as your target:<code bash> +To restore the backed up database into a new database, create a new database using the ''template0'' database template, set the locale to "C" and the encoding as UNICODEthen run the ''pg_restore'' command, specifying the new database as your target. Replace "x.x" with your version of PostgreSQL:<code bash> 
-createdb -T template0 -E UTF8 -U evergreen -h localhost new_evergreen +createdb -T template0 --lc-ctype=C --lc-collate=C -E UNICODE evergreen 
-psql -U evergreen -h localhost -evergreen_db.backup.2008-06-15 new_evergreen+createlang plperl   evergreen 
 +createlang plperlu  evergreen 
 +createlang plpgsql  evergreen 
 +psql -f /usr/share/postgresql/x.x/contrib/tablefunc.sql evergreen 
 +psql -f /usr/share/postgresql/x.x/contrib/tsearch2.sql  evergreen 
 +psql -f /usr/share/postgresql/x.x/contrib/pgxml.sql     evergreen 
 + 
 +# pg_restore -U evergreen -h localhost -d <db_name> -v "<backup_file_name>" -W 
 +pg_restore -U evergreen -h localhost -d evergreen -v evergreen_db.backup -W
 </code> </code>
-Note that this method of backup is only suitable for small Evergreen instances. Larger sites should consider implementing continuous archiving (also known as "log shipping") to provide more granular backups with lower system overhead. More information on backing up PostgreSQL databases can be found in the [[http://www.postgresql.org/docs/8.2/interactive/backup.html|official PostgreSQL documentation]].+Note that if using PostgreSQL 8.4 or newer, it is recommend that you use the option -j=X for parallel loads where X is the number of parallel processes. 
 + 
 +Also this method of backup is only suitable for small Evergreen instances. Larger sites should consider implementing continuous archiving (also known as "log shipping") to provide more granular backups with lower system overhead. More information on backing up PostgreSQL databases can be found in the [[http://www.postgresql.org/docs/8.2/interactive/backup.html|official PostgreSQL documentation]].
  
 =====Customizations to Evergreen configuration files===== =====Customizations to Evergreen configuration files=====

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.