NAME
we_dump - dump a WE ObjDB database
SYNOPSIS
we_dump [-version] [-root id | -id id] [-class dbclass] [-lang lang]
[-attribs] [-contentattribs] [-[no]lock] [-[no]connect] [-[no]readonly]
[-[no]failsafe] [-datadumper] [-o outfile] [rootdir]
DESCRIPTION
we_dump dumps a ObjDB database (only!) to a text file using Data::Dumper. The resulting file may be used to restore a database with the means described in "EXAMPLES".
OPTIONS
- -version
-
Show also version objects
- -root id
-
Start dump at the given object id (otherwise the whole database is dumped)
- -id id
-
Alias for -root id.
- -class dbclass
-
Specify WE::DB class e.g. WE_Singlesite::Root
- -lang lang
-
Specify language for titles (default is "en" or the value of the
LANG
environment variable). - -attribs
-
Show also attributes (very verbose!)
- -contentattribs
-
Show also content attributes (page type, languges...)
- -lock
-
Lock database (for debugging lock problems)
- -connect
-
Create permanent connection to database (for debugging, default is on)
- -readonly
-
Open readonly connection to database (default is readonly).
- -nofailsafe
-
Do not open in failsafe mode (default is failsafe)
- -datadumper
-
Do a Data::Dumper dump of the object database.
- -o file
-
Only in conjunction with -datadumper: use the specified file for output. Otherwise Data::Dumper output goes to STDOUT.
- -versioning
-
Use RCS versioning for a Data::Dumper file.
- rootdir
-
The root directory of the database (default is
.
, the current directory).
EXAMPLES
A sample crontab entry for making an hourly backup of the object database:
0 * * * * we_dump -datadumper -versioning -outfile /path/to/dumpfile /path/to/we_data
To restore such a dump, the following steps should be done:
Identify the wished dump version by using
rlog
andco -p -rversion
.Extract this dump version, e.g.
co -p -r1.78 dumpfile > dumpfile-1.78
Recreate the object database. Assuming a common installation using MLDBM, DB_File and Data::Dumper, the following one-liner may be used:
perl -MMLDBM=DB_File,Data::Dumper -MFcntl -e 'tie %db, "MLDBM", "objdb.db", O_RDWR|O_CREAT, 0644 or die $!; $ObjDB = do $ARGV[0]; %db = %$ObjDB' dumpfile-version
Move the created objdb.db to the we_data directory and fix permissions.
AUTHOR
Slaven Rezic <eserte@users.sourceforge.net>